append the flag_swap_transaction once all checks pass
Some checks failed
release / docker (push) Has been cancelled

This commit is contained in:
Alfred Kamanda 2026-01-15 11:25:02 +03:00
parent b337c9260b
commit 523f680276
Signed by: Alfred-mk
GPG Key ID: E60B2165A97F4D41

View File

@ -344,8 +344,6 @@ func (h *MenuHandlers) MaxAmount(ctx context.Context, sym string, input []byte)
return res, nil return res, nil
} }
res.FlagSet = append(res.FlagSet, flag_swap_transaction)
// Resolve active pool address // Resolve active pool address
activePoolAddress, err := h.resolveActivePoolAddress(ctx, sessionId) activePoolAddress, err := h.resolveActivePoolAddress(ctx, sessionId)
if err != nil { if err != nil {
@ -385,7 +383,6 @@ func (h *MenuHandlers) MaxAmount(ctx context.Context, sym string, input []byte)
res.FlagReset = append(res.FlagReset, flag_swap_transaction) res.FlagReset = append(res.FlagReset, flag_swap_transaction)
res.Content = l.Get("Maximum amount: %s %s\nEnter amount:", formattedBalance, string(activeSym)) res.Content = l.Get("Maximum amount: %s %s\nEnter amount:", formattedBalance, string(activeSym))
fmt.Println("the FlagReset:", res.FlagReset, "the FlagSet:", res.FlagSet)
return res, nil return res, nil
} }
@ -417,6 +414,9 @@ func (h *MenuHandlers) MaxAmount(ctx context.Context, sym string, input []byte)
return res, err return res, err
} }
// only set the flag once all checks pass
res.FlagSet = append(res.FlagSet, flag_swap_transaction)
res.Content = l.Get( res.Content = l.Get(
"Credit Available: %s %s\n(You can swap up to %s %s -> %s %s).\nEnter %s amount:", "Credit Available: %s %s\n(You can swap up to %s %s -> %s %s).\nEnter %s amount:",
maxRAT, maxRAT,