From e4c10d23d3d8c8ccc0be1be9df798e8d95c67cc1 Mon Sep 17 00:00:00 2001 From: Alfred Kamanda Date: Tue, 3 Feb 2026 16:49:11 +0300 Subject: [PATCH] reset the flags to clear out old states --- handlers/application/paydebt.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/handlers/application/paydebt.go b/handlers/application/paydebt.go index 086b660..896dabd 100644 --- a/handlers/application/paydebt.go +++ b/handlers/application/paydebt.go @@ -28,6 +28,7 @@ func (h *MenuHandlers) CalculateMaxPayDebt(ctx context.Context, sym string, inpu inputStr := string(input) if inputStr == "0" || inputStr == "9" { + res.FlagReset = append(res.FlagReset, flag_low_swap_amount, flag_api_call_error) return res, nil } @@ -36,11 +37,13 @@ func (h *MenuHandlers) CalculateMaxPayDebt(ctx context.Context, sym string, inpu // Resolve active pool _, activePoolName, err := h.resolveActivePoolDetails(ctx, sessionId) if err != nil { + res.FlagReset = append(res.FlagReset, flag_low_swap_amount, flag_api_call_error) return res, err } metadata, err := store.GetSwapToVoucherData(ctx, userStore, sessionId, "1") if err != nil { + res.FlagReset = append(res.FlagReset, flag_low_swap_amount, flag_api_call_error) return res, fmt.Errorf("failed to retrieve swap to voucher data: %v", err) } if metadata == nil { @@ -111,6 +114,8 @@ func (h *MenuHandlers) CalculateMaxPayDebt(ctx context.Context, sym string, inpu swapData.ActiveSwapToSym, ) + res.FlagReset = append(res.FlagReset, flag_low_swap_amount, flag_api_call_error) + return res, nil }