NFC: fix retry scene navigation logic (#3439)

* nfc app: fix retry scene navigation logic
* nfc app: fix navigation in exit confirm scene

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
gornekich 2024-02-12 02:23:44 +00:00 committed by GitHub
parent 6836a7b7c5
commit b0df852944
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View File

@ -31,6 +31,13 @@ bool nfc_scene_exit_confirm_on_event(void* context, SceneManagerEvent event) {
if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSelectProtocol)) {
consumed = scene_manager_search_and_switch_to_previous_scene(
nfc->scene_manager, NfcSceneSelectProtocol);
} else if(
scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneMfClassicDictAttack) &&
(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneReadMenu) ||
scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSavedMenu))) {
const uint32_t possible_scenes[] = {NfcSceneReadMenu, NfcSceneSavedMenu};
consumed = scene_manager_search_and_switch_to_previous_scene_one_of(
nfc->scene_manager, possible_scenes, COUNT_OF(possible_scenes));
} else {
consumed = scene_manager_search_and_switch_to_previous_scene(
nfc->scene_manager, NfcSceneStart);

View File

@ -31,8 +31,10 @@ bool nfc_scene_retry_confirm_on_event(void* context, SceneManagerEvent event) {
if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSlixUnlock)) {
consumed = scene_manager_search_and_switch_to_previous_scene(
nfc->scene_manager, NfcSceneSlixUnlock);
} else if(scene_manager_has_previous_scene(
nfc->scene_manager, NfcSceneMfClassicDictAttack)) {
} else if(
scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneMfClassicDictAttack) &&
(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneReadMenu) ||
scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSavedMenu))) {
consumed = scene_manager_search_and_switch_to_previous_scene(
nfc->scene_manager, NfcSceneMfClassicDictAttack);
} else if(scene_manager_has_previous_scene(