reset appropriate error flags on success
Some checks failed
release / docker (push) Has been cancelled

This commit is contained in:
Alfred Kamanda 2026-02-23 17:46:52 +03:00
parent 43c4b64b42
commit eea51ea40d
Signed by: Alfred-mk
GPG Key ID: 7EA3D01708908703

View File

@ -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 {