only set the flag if the user has a single voucher
This commit is contained in:
parent
a346adb8f9
commit
96ba48bcba
@ -33,6 +33,7 @@ func (h *MenuHandlers) ManageVouchers(ctx context.Context, sym string, input []b
|
|||||||
flag_no_active_voucher, _ := h.flagManager.GetFlag("flag_no_active_voucher")
|
flag_no_active_voucher, _ := h.flagManager.GetFlag("flag_no_active_voucher")
|
||||||
flag_api_error, _ := h.flagManager.GetFlag("flag_api_call_error")
|
flag_api_error, _ := h.flagManager.GetFlag("flag_api_call_error")
|
||||||
flag_no_stable_vouchers, _ := h.flagManager.GetFlag("flag_no_stable_vouchers")
|
flag_no_stable_vouchers, _ := h.flagManager.GetFlag("flag_no_stable_vouchers")
|
||||||
|
flag_single_voucher, _ := h.flagManager.GetFlag("flag_single_voucher")
|
||||||
|
|
||||||
publicKey, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_PUBLIC_KEY)
|
publicKey, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_PUBLIC_KEY)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -73,6 +74,13 @@ func (h *MenuHandlers) ManageVouchers(ctx context.Context, sym string, input []b
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// only set the flag if the user has a single voucher
|
||||||
|
if len(vouchersResp) == 1 {
|
||||||
|
res.FlagSet = append(res.FlagSet, flag_single_voucher)
|
||||||
|
} else {
|
||||||
|
res.FlagReset = append(res.FlagReset, flag_single_voucher)
|
||||||
|
}
|
||||||
|
|
||||||
res.FlagReset = append(res.FlagReset, flag_no_active_voucher)
|
res.FlagReset = append(res.FlagReset, flag_no_active_voucher)
|
||||||
|
|
||||||
// add a variable to filter out the active voucher
|
// add a variable to filter out the active voucher
|
||||||
|
|||||||
@ -37,3 +37,4 @@ flag,flag_low_swap_amount,43,this is set when the swap max limit is less than 0.
|
|||||||
flag,flag_alias_unavailable,44,this is set when the preferred alias is not available
|
flag,flag_alias_unavailable,44,this is set when the preferred alias is not available
|
||||||
flag,flag_swap_transaction,45,this is set when the transaction will involve performing a swap
|
flag,flag_swap_transaction,45,this is set when the transaction will involve performing a swap
|
||||||
flag,flag_no_stable_vouchers,46,this is set when the user does not have a stable voucher
|
flag,flag_no_stable_vouchers,46,this is set when the user does not have a stable voucher
|
||||||
|
flag,flag_single_voucher,47,this is set when the user only has a single voucher
|
||||||
|
|||||||
|
Loading…
Reference in New Issue
Block a user