reset appropriate error flags on success
Some checks failed
release / docker (push) Has been cancelled
Some checks failed
release / docker (push) Has been cancelled
This commit is contained in:
parent
43c4b64b42
commit
eea51ea40d
@ -123,6 +123,8 @@ func (h *MenuHandlers) GetMpesaMaxLimit(ctx context.Context, sym string, input [
|
||||
maxKshFormatted,
|
||||
)
|
||||
|
||||
res.FlagReset = append(res.FlagReset, flag_low_swap_amount, flag_api_call_error, flag_incorrect_voucher, flag_incorrect_pool)
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
@ -155,6 +157,8 @@ func (h *MenuHandlers) GetMpesaMaxLimit(ctx context.Context, sym string, input [
|
||||
return res, nil
|
||||
}
|
||||
|
||||
res.FlagReset = append(res.FlagReset, flag_api_call_error)
|
||||
|
||||
// Fallback if below minimum
|
||||
maxFloat, _ := strconv.ParseFloat(maxRAT, 64)
|
||||
if maxFloat < 0.1 {
|
||||
@ -164,6 +168,8 @@ func (h *MenuHandlers) GetMpesaMaxLimit(ctx context.Context, sym string, input [
|
||||
return res, nil
|
||||
}
|
||||
|
||||
res.FlagReset = append(res.FlagReset, flag_low_swap_amount)
|
||||
|
||||
// Save max RAT amount to be used in validating the user's input
|
||||
err = userStore.WriteEntry(ctx, sessionId, storedb.DATA_ACTIVE_SWAP_MAX_AMOUNT, []byte(maxRAT))
|
||||
if err != nil {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user