debt-menu #115

Open
Alfred-mk wants to merge 74 commits from debt-menu into master
Showing only changes of commit e4c10d23d3 - Show all commits

View File

@ -28,6 +28,7 @@ func (h *MenuHandlers) CalculateMaxPayDebt(ctx context.Context, sym string, inpu
inputStr := string(input) inputStr := string(input)
if inputStr == "0" || inputStr == "9" { if inputStr == "0" || inputStr == "9" {
res.FlagReset = append(res.FlagReset, flag_low_swap_amount, flag_api_call_error)
return res, nil return res, nil
} }
@ -36,11 +37,13 @@ func (h *MenuHandlers) CalculateMaxPayDebt(ctx context.Context, sym string, inpu
// Resolve active pool // Resolve active pool
_, activePoolName, err := h.resolveActivePoolDetails(ctx, sessionId) _, activePoolName, err := h.resolveActivePoolDetails(ctx, sessionId)
if err != nil { if err != nil {
res.FlagReset = append(res.FlagReset, flag_low_swap_amount, flag_api_call_error)
return res, err return res, err
} }
metadata, err := store.GetSwapToVoucherData(ctx, userStore, sessionId, "1") metadata, err := store.GetSwapToVoucherData(ctx, userStore, sessionId, "1")
if err != nil { 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) return res, fmt.Errorf("failed to retrieve swap to voucher data: %v", err)
} }
if metadata == nil { if metadata == nil {
@ -111,6 +114,8 @@ func (h *MenuHandlers) CalculateMaxPayDebt(ctx context.Context, sym string, inpu
swapData.ActiveSwapToSym, swapData.ActiveSwapToSym,
) )
res.FlagReset = append(res.FlagReset, flag_low_swap_amount, flag_api_call_error)
return res, nil return res, nil
} }