mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-13 13:09:49 +04:00
[FL-3752] Fix iButton/LFRFID Add Manually results being discarded (#3749)
Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -36,6 +36,10 @@ bool ibutton_scene_add_value_on_event(void* context, SceneManagerEvent event) {
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
consumed = true;
|
||||
if(event.event == iButtonCustomEventByteEditResult) {
|
||||
if(scene_manager_has_previous_scene(scene_manager, iButtonSceneAddType)) {
|
||||
ibutton_protocols_apply_edits(ibutton->protocols, ibutton->key);
|
||||
scene_manager_next_scene(scene_manager, iButtonSceneSaveName);
|
||||
} else {
|
||||
furi_string_printf(
|
||||
ibutton->file_path,
|
||||
"%s/%s%s",
|
||||
@@ -52,6 +56,7 @@ bool ibutton_scene_add_value_on_event(void* context, SceneManagerEvent event) {
|
||||
scene_manager_search_and_switch_to_previous_scene_one_of(
|
||||
ibutton->scene_manager, possible_scenes, COUNT_OF(possible_scenes));
|
||||
}
|
||||
}
|
||||
} else if(event.event == iButtonCustomEventByteEditChanged) {
|
||||
ibutton_protocols_apply_edits(ibutton->protocols, ibutton->key);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,9 @@ bool lfrfid_scene_save_data_on_event(void* context, SceneManagerEvent event) {
|
||||
size_t size = protocol_dict_get_data_size(app->dict, app->protocol_id);
|
||||
protocol_dict_set_data(app->dict, app->protocol_id, app->new_key_data, size);
|
||||
|
||||
if(scene_manager_has_previous_scene(scene_manager, LfRfidSceneSaveType)) {
|
||||
scene_manager_next_scene(scene_manager, LfRfidSceneSaveName);
|
||||
} else {
|
||||
if(!furi_string_empty(app->file_name)) {
|
||||
lfrfid_delete_key(app);
|
||||
}
|
||||
@@ -43,6 +46,7 @@ bool lfrfid_scene_save_data_on_event(void* context, SceneManagerEvent event) {
|
||||
scene_manager, LfRfidSceneSavedKeyMenu);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(event.type == SceneManagerEventTypeBack) {
|
||||
scene_manager_set_scene_state(scene_manager, LfRfidSceneSaveData, 0);
|
||||
size_t size = protocol_dict_get_data_size(app->dict, app->protocol_id);
|
||||
|
||||
Reference in New Issue
Block a user