Compare commits

...

2 Commits

Author SHA1 Message Date
a72fb08dc8
allow sequential profile edit 2024-12-03 11:20:35 +03:00
944fa89b3c
add profile holder struct 2024-12-03 11:19:38 +03:00
3 changed files with 17 additions and 3 deletions

14
models/profile.go Normal file
View File

@ -0,0 +1,14 @@
package models
type Profile struct {
ProfileItems []string
Max int
}
func (p *Profile) InsertOrShift(index int, value string) {
if index < len(p.ProfileItems) {
p.ProfileItems = append(p.ProfileItems[:index], value)
} else {
p.ProfileItems = append(p.ProfileItems, value)
}
}

View File

@ -3,8 +3,8 @@ LOAD get_current_profile_info 0
RELOAD get_current_profile_info
MAP get_current_profile_info
MOUT back 0
LOAD save_familyname 64
HALT
LOAD save_familyname 64
RELOAD save_familyname
INCMP _ 0
CATCH pin_entry flag_familyname_set 1

View File

@ -2,10 +2,10 @@ CATCH update_firstname flag_allow_update 1
LOAD get_current_profile_info 0
RELOAD get_current_profile_info
MAP get_current_profile_info
LOAD save_firstname 128
MOUT back 0
HALT
RELOAD save_firstname
INCMP _ 0
LOAD save_firstname 128
RELOAD save_firstname
CATCH pin_entry flag_firstname_set 1
INCMP edit_family_name *