Compare commits
4 Commits
eaa89c29df
...
9674a04cbc
Author | SHA1 | Date | |
---|---|---|---|
9674a04cbc | |||
6c46c097fb | |||
c814c4ae5c | |||
bbecec0310 |
@ -487,6 +487,14 @@ func (h *MenuHandlers) ResetInvalidPIN(ctx context.Context, sym string, input []
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ResetApiCallFailure resets the api call failure flag
|
||||||
|
func (h *MenuHandlers) ResetApiCallFailure(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
||||||
|
var res resource.Result
|
||||||
|
flag_api_error, _ := h.flagManager.GetFlag("flag_api_call_error")
|
||||||
|
res.FlagReset = append(res.FlagReset, flag_api_error)
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|
||||||
// ConfirmPinChange validates user's new PIN. If input matches the temporary PIN, saves it as the new account PIN.
|
// ConfirmPinChange validates user's new PIN. If input matches the temporary PIN, saves it as the new account PIN.
|
||||||
func (h *MenuHandlers) ConfirmPinChange(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
func (h *MenuHandlers) ConfirmPinChange(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
||||||
var res resource.Result
|
var res resource.Result
|
||||||
@ -2508,6 +2516,8 @@ func (h *MenuHandlers) RequestCustomAlias(ctx context.Context, sym string, input
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flag_api_error, _ := h.flagManager.GetFlag("flag_api_call_error")
|
||||||
|
|
||||||
store := h.userdataStore
|
store := h.userdataStore
|
||||||
aliasHint, err := store.ReadEntry(ctx, sessionId, storedb.DATA_TEMPORARY_VALUE)
|
aliasHint, err := store.ReadEntry(ctx, sessionId, storedb.DATA_TEMPORARY_VALUE)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -2531,9 +2541,12 @@ func (h *MenuHandlers) RequestCustomAlias(ctx context.Context, sym string, input
|
|||||||
sanitizedInput := sanitizeAliasHint(string(input))
|
sanitizedInput := sanitizeAliasHint(string(input))
|
||||||
aliasResult, err := h.accountService.RequestAlias(ctx, string(pubKey), sanitizedInput)
|
aliasResult, err := h.accountService.RequestAlias(ctx, string(pubKey), sanitizedInput)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
res.FlagSet = append(res.FlagSet, flag_api_error)
|
||||||
logg.ErrorCtxf(ctx, "failed to retrieve alias", "alias", string(aliasHint), "error_alias_request", err)
|
logg.ErrorCtxf(ctx, "failed to retrieve alias", "alias", string(aliasHint), "error_alias_request", err)
|
||||||
return res, fmt.Errorf("Failed to retrieve alias: %s", err.Error())
|
return res, nil
|
||||||
}
|
}
|
||||||
|
res.FlagReset = append(res.FlagReset, flag_api_error)
|
||||||
|
|
||||||
alias := aliasResult.Alias
|
alias := aliasResult.Alias
|
||||||
logg.InfoCtxf(ctx, "Suggested alias ", "alias", alias)
|
logg.InfoCtxf(ctx, "Suggested alias ", "alias", alias)
|
||||||
|
|
||||||
|
@ -129,6 +129,7 @@ func (ls *LocalHandlerService) GetHandler(accountService remote.AccountService)
|
|||||||
ls.DbRs.AddLocalFunc("get_suggested_alias", appHandlers.GetSuggestedAlias)
|
ls.DbRs.AddLocalFunc("get_suggested_alias", appHandlers.GetSuggestedAlias)
|
||||||
ls.DbRs.AddLocalFunc("confirm_new_alias", appHandlers.ConfirmNewAlias)
|
ls.DbRs.AddLocalFunc("confirm_new_alias", appHandlers.ConfirmNewAlias)
|
||||||
ls.DbRs.AddLocalFunc("check_account_created", appHandlers.CheckAccountCreated)
|
ls.DbRs.AddLocalFunc("check_account_created", appHandlers.CheckAccountCreated)
|
||||||
|
ls.DbRs.AddLocalFunc("reset_api_call_failure", appHandlers.ResetApiCallFailure)
|
||||||
|
|
||||||
ls.first = appHandlers.Init
|
ls.first = appHandlers.Init
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
LOAD reset_api_call_failure 6
|
||||||
|
RELOAD reset_api_call_failure
|
||||||
MOUT retry 1
|
MOUT retry 1
|
||||||
MOUT quit 9
|
MOUT quit 9
|
||||||
HALT
|
HALT
|
||||||
|
@ -5,4 +5,5 @@ HALT
|
|||||||
INCMP _ 0
|
INCMP _ 0
|
||||||
LOAD request_custom_alias 0
|
LOAD request_custom_alias 0
|
||||||
RELOAD request_custom_alias
|
RELOAD request_custom_alias
|
||||||
|
CATCH api_failure flag_api_call_error 1
|
||||||
INCMP confirm_new_alias *
|
INCMP confirm_new_alias *
|
||||||
|
Loading…
Reference in New Issue
Block a user