add edit single option on save_firstname function

This commit is contained in:
Carlosokumu 2024-09-23 10:50:34 +03:00
parent aec2f3db29
commit 05749b493a
Signed by: carlos
GPG Key ID: 7BD6BC8160A5C953

View File

@ -298,8 +298,6 @@ func (h *Handlers) VerifyPin(ctx context.Context, sym string, input []byte) (res
if !ok {
return res, fmt.Errorf("missing session")
}
//AccountPin, _ := utils.ReadEntry(ctx, h.userdataStore, sessionId, utils.DATA_ACCOUNT_PIN)
store := h.userdataStore
AccountPin, err := store.ReadEntry(ctx, sessionId, utils.DATA_ACCOUNT_PIN)
if err != nil {
@ -336,6 +334,12 @@ func (h *Handlers) SaveFirstname(ctx context.Context, sym string, input []byte)
return res, fmt.Errorf("missing session")
}
flag_allow_update, _ := h.flagManager.GetFlag("flag_allow_update")
flag_single_edit, _ := h.flagManager.GetFlag("flag_single_edit")
res.FlagReset = append(res.FlagReset, flag_allow_update)
res.FlagSet = append(res.FlagSet, flag_single_edit)
if len(input) > 0 {
firstName := string(input)
store := h.userdataStore
@ -378,15 +382,6 @@ func (h *Handlers) SaveYob(ctx context.Context, sym string, input []byte) (resou
if !ok {
return res, fmt.Errorf("missing session")
}
flag_allow_update, _ := h.flagManager.GetFlag("flag_allow_update")
flag_single_edit, _ := h.flagManager.GetFlag("flag_single_edit")
execPath := utils.GetSingleEditExecutionPath("save_yob")
isSingleEdit := utils.MatchNavigationPath(execPath, h.st.ExecPath)
if isSingleEdit {
res.FlagReset = append(res.FlagReset, flag_allow_update)
res.FlagSet = append(res.FlagSet, flag_single_edit)
}
if len(input) == 4 {
yob := string(input)
store := h.userdataStore
@ -407,17 +402,6 @@ func (h *Handlers) SaveLocation(ctx context.Context, sym string, input []byte) (
if !ok {
return res, fmt.Errorf("missing session")
}
flag_allow_update, _ := h.flagManager.GetFlag("flag_allow_update")
flag_single_edit, _ := h.flagManager.GetFlag("flag_single_edit")
execPath := utils.GetSingleEditExecutionPath("save_location")
isSingleEdit := utils.MatchNavigationPath(execPath, h.st.ExecPath)
if isSingleEdit {
res.FlagReset = append(res.FlagReset, flag_allow_update)
res.FlagSet = append(res.FlagSet, flag_single_edit)
}
if len(input) > 0 {
location := string(input)
store := h.userdataStore
@ -438,15 +422,6 @@ func (h *Handlers) SaveGender(ctx context.Context, sym string, input []byte) (re
if !ok {
return res, fmt.Errorf("missing session")
}
flag_allow_update, _ := h.flagManager.GetFlag("flag_allow_update")
flag_single_edit, _ := h.flagManager.GetFlag("flag_single_edit")
execPath := utils.GetSingleEditExecutionPath("select_gender")
isSingleEdit := utils.MatchNavigationPath(execPath, h.st.ExecPath)
if isSingleEdit {
res.FlagReset = append(res.FlagReset, flag_allow_update)
res.FlagSet = append(res.FlagSet, flag_single_edit)
}
code := codeFromCtx(ctx)
if len(input) > 0 {
gender := string(input)