Skip to content

Commit eaeee87

Browse files
authored
Picopass: populate key change input with first key of user dictionary (#54)
1 parent b349f4c commit eaeee87

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scenes/picopass_scene_key_menu.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,16 @@ bool picopass_scene_key_menu_on_event(void* context, SceneManagerEvent event) {
9191
scene_manager_next_scene(picopass->scene_manager, PicopassSceneWriteKey);
9292
consumed = true;
9393
} else if(event.event == SubmenuIndexWriteCustom) {
94+
// If user dictionary, prepopulate with the first key
95+
if(iclass_elite_dict_check_presence(IclassEliteDictTypeUser)) {
96+
IclassEliteDict* dict = iclass_elite_dict_alloc(IclassEliteDictTypeUser);
97+
iclass_elite_dict_get_next_key(dict, picopass->byte_input_store);
98+
iclass_elite_dict_free(dict);
99+
}
100+
94101
scene_manager_set_scene_state(
95102
picopass->scene_manager, PicopassSceneKeyMenu, SubmenuIndexWriteCustom);
96-
// Key and elite_kdf = true are both set in key_input scene
103+
// Key and elite_kdf = true are both set in key_input scene after the value is input
97104
scene_manager_next_scene(picopass->scene_manager, PicopassSceneKeyInput);
98105
consumed = true;
99106
}

0 commit comments

Comments
 (0)