reset the flag_language_set and flag_account_created flags if the publicKey does not exist on the db
Some checks failed
release / docker (push) Has been cancelled

This commit is contained in:
Alfred Kamanda 2025-04-04 12:05:04 +03:00
parent 4268cc0589
commit a11ca2a618
Signed by: Alfred-mk
GPG Key ID: 7EA3D01708908703

View File

@ -245,6 +245,7 @@ func (h *MenuHandlers) CreateAccount(ctx context.Context, sym string, input []by
func (h *MenuHandlers) CheckAccountCreated(ctx context.Context, sym string, input []byte) (resource.Result, error) { func (h *MenuHandlers) CheckAccountCreated(ctx context.Context, sym string, input []byte) (resource.Result, error) {
var res resource.Result var res resource.Result
flag_language_set, _ := h.flagManager.GetFlag("flag_language_set")
flag_account_created, _ := h.flagManager.GetFlag("flag_account_created") flag_account_created, _ := h.flagManager.GetFlag("flag_account_created")
store := h.userdataStore store := h.userdataStore
@ -256,11 +257,17 @@ func (h *MenuHandlers) CheckAccountCreated(ctx context.Context, sym string, inpu
_, err := store.ReadEntry(ctx, sessionId, storedb.DATA_PUBLIC_KEY) _, err := store.ReadEntry(ctx, sessionId, storedb.DATA_PUBLIC_KEY)
if err != nil { if err != nil {
if !db.IsNotFound(err) { if db.IsNotFound(err) {
return res, err // reset major flags
res.FlagReset = append(res.FlagReset, flag_language_set)
res.FlagReset = append(res.FlagReset, flag_account_created)
return res, nil
} }
return res, nil return res, nil
} }
res.FlagSet = append(res.FlagSet, flag_account_created) res.FlagSet = append(res.FlagSet, flag_account_created)
return res, nil return res, nil
} }