added ClearTransactionTypeFlag when a user goes back
Some checks are pending
release / docker (push) Waiting to run
Some checks are pending
release / docker (push) Waiting to run
This commit is contained in:
parent
34271cba23
commit
ba9a23946f
@ -836,3 +836,19 @@ func (h *MenuHandlers) TransactionInitiateSwap(ctx context.Context, sym string,
|
|||||||
res.FlagReset = append(res.FlagReset, flag_account_authorized, flag_swap_transaction)
|
res.FlagReset = append(res.FlagReset, flag_account_authorized, flag_swap_transaction)
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ClearTransactionTypeFlag resets the flag when a user goes back.
|
||||||
|
func (h *MenuHandlers) ClearTransactionTypeFlag(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
||||||
|
var res resource.Result
|
||||||
|
|
||||||
|
flag_swap_transaction, _ := h.flagManager.GetFlag("flag_swap_transaction")
|
||||||
|
|
||||||
|
inputStr := string(input)
|
||||||
|
if inputStr == "0" {
|
||||||
|
res.FlagReset = append(res.FlagReset, flag_swap_transaction)
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
@ -138,6 +138,7 @@ func (ls *LocalHandlerService) GetHandler(accountService remote.AccountService)
|
|||||||
ls.DbRs.AddLocalFunc("initiate_swap", appHandlers.InitiateSwap)
|
ls.DbRs.AddLocalFunc("initiate_swap", appHandlers.InitiateSwap)
|
||||||
ls.DbRs.AddLocalFunc("transaction_swap_preview", appHandlers.TransactionSwapPreview)
|
ls.DbRs.AddLocalFunc("transaction_swap_preview", appHandlers.TransactionSwapPreview)
|
||||||
ls.DbRs.AddLocalFunc("transaction_initiate_swap", appHandlers.TransactionInitiateSwap)
|
ls.DbRs.AddLocalFunc("transaction_initiate_swap", appHandlers.TransactionInitiateSwap)
|
||||||
|
ls.DbRs.AddLocalFunc("clear_trans_type_flag", appHandlers.ClearTransactionTypeFlag)
|
||||||
|
|
||||||
ls.first = appHandlers.Init
|
ls.first = appHandlers.Init
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@ RELOAD max_amount
|
|||||||
MAP max_amount
|
MAP max_amount
|
||||||
MOUT back 0
|
MOUT back 0
|
||||||
HALT
|
HALT
|
||||||
|
LOAD clear_trans_type_flag 6
|
||||||
|
RELOAD clear_trans_type_flag
|
||||||
CATCH transaction_swap flag_swap_transaction 1
|
CATCH transaction_swap flag_swap_transaction 1
|
||||||
LOAD validate_amount 64
|
LOAD validate_amount 64
|
||||||
RELOAD validate_amount
|
RELOAD validate_amount
|
||||||
|
Loading…
Reference in New Issue
Block a user