diff --git a/handlers/application/send.go b/handlers/application/send.go index 7b09eea..bbcea64 100644 --- a/handlers/application/send.go +++ b/handlers/application/send.go @@ -344,8 +344,6 @@ func (h *MenuHandlers) MaxAmount(ctx context.Context, sym string, input []byte) return res, nil } - res.FlagSet = append(res.FlagSet, flag_swap_transaction) - // Resolve active pool address activePoolAddress, err := h.resolveActivePoolAddress(ctx, sessionId) 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.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 } @@ -417,6 +414,9 @@ func (h *MenuHandlers) MaxAmount(ctx context.Context, sym string, input []byte) return res, err } + // only set the flag once all checks pass + res.FlagSet = append(res.FlagSet, flag_swap_transaction) + res.Content = l.Get( "Credit Available: %s %s\n(You can swap up to %s %s -> %s %s).\nEnter %s amount:", maxRAT,