[FL-2717] Fix unexpected behaviour when opening a remote from outside (#1538)

* Fix unexpected behaviour when opening remote from outside
* Same fix for editing button name
* Exit application correctly if remote was deleted
* Remove duplicate function from ibutton
* Use COUNT_OF macro

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Georgii Surkov
2022-08-05 18:38:20 +03:00
committed by GitHub
parent 55b4ff8e0c
commit d147190d61
10 changed files with 20 additions and 32 deletions

View File

@@ -28,8 +28,10 @@ bool infrared_scene_edit_delete_done_on_event(void* context, SceneManagerEvent e
scene_manager, InfraredSceneRemote);
} else if(edit_target == InfraredEditTargetRemote) {
const uint32_t possible_scenes[] = {InfraredSceneStart, InfraredSceneRemoteList};
scene_manager_search_and_switch_to_previous_scene_one_of(
scene_manager, possible_scenes, sizeof(possible_scenes) / sizeof(uint32_t));
if(!scene_manager_search_and_switch_to_previous_scene_one_of(
scene_manager, possible_scenes, COUNT_OF(possible_scenes))) {
view_dispatcher_stop(infrared->view_dispatcher);
}
} else {
furi_assert(0);
}