Skip to content

Commit 2cbd058

Browse files
committed
make NFC emulation loading from favourites faster
1 parent c40a63e commit 2cbd058

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

applications/main/nfc/helpers/protocol_support/nfc_protocol_support.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ static bool nfc_protocol_support_scene_rpc_on_event(NfcApp* instance, SceneManag
719719
if(event.event == NfcCustomEventRpcLoadFile) {
720720
bool success = false;
721721
if(instance->rpc_state == NfcRpcStateIdle) {
722-
if(nfc_load_file(instance, instance->file_path, false)) {
722+
if(nfc_load_file(instance, instance->file_path, false, false)) {
723723
nfc_protocol_support_scene_rpc_setup_ui_and_emulate(instance);
724724
success = true;
725725
}

applications/main/nfc/nfc_app.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -340,12 +340,14 @@ bool nfc_save(NfcApp* instance) {
340340
return nfc_save_internal(instance, NFC_APP_EXTENSION);
341341
}
342342

343-
bool nfc_load_file(NfcApp* instance, FuriString* path, bool show_dialog) {
343+
bool nfc_load_file(NfcApp* instance, FuriString* path, bool show_dialog, bool load_plugins) {
344344
furi_assert(instance);
345345
furi_assert(path);
346346
bool result = false;
347347

348-
nfc_supported_cards_load_cache(instance->nfc_supported_cards);
348+
if(load_plugins) {
349+
nfc_supported_cards_load_cache(instance->nfc_supported_cards);
350+
}
349351

350352
FuriString* load_path = furi_string_alloc();
351353
if(nfc_has_shadow_file_internal(instance, path)) { //-V1051
@@ -414,7 +416,7 @@ bool nfc_load_from_file_select(NfcApp* instance) {
414416
if(!dialog_file_browser_show(
415417
instance->dialogs, instance->file_path, instance->file_path, &browser_options))
416418
break;
417-
success = nfc_load_file(instance, instance->file_path, true);
419+
success = nfc_load_file(instance, instance->file_path, true, true);
418420
} while(!success);
419421

420422
return success;
@@ -507,7 +509,7 @@ int32_t nfc_app(void* p) {
507509
nfc->view_dispatcher, nfc->gui, ViewDispatcherTypeFullscreen);
508510

509511
furi_string_set(nfc->file_path, args);
510-
if(nfc_load_file(nfc, nfc->file_path, false)) {
512+
if(nfc_load_file(nfc, nfc->file_path, false, false)) {
511513
nfc_show_initial_scene_for_device(nfc);
512514
} else {
513515
view_dispatcher_stop(nfc->view_dispatcher);

applications/main/nfc/nfc_app_i.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ bool nfc_delete(NfcApp* instance);
188188

189189
bool nfc_load_from_file_select(NfcApp* instance);
190190

191-
bool nfc_load_file(NfcApp* instance, FuriString* path, bool show_dialog);
191+
bool nfc_load_file(NfcApp* instance, FuriString* path, bool show_dialog, bool load_plugins);
192192

193193
bool nfc_save_file(NfcApp* instance, FuriString* path);
194194

applications/main/nfc/scenes/nfc_scene_restore_original.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ bool nfc_scene_restore_original_on_event(void* context, SceneManagerEvent event)
2525

2626
if(event.type == SceneManagerEventTypeCustom) {
2727
if(event.event == NfcCustomEventViewExit) {
28-
if(nfc_load_file(nfc, nfc->file_path, false)) {
28+
if(nfc_load_file(nfc, nfc->file_path, false, false)) {
2929
consumed = scene_manager_search_and_switch_to_previous_scene(
3030
nfc->scene_manager, NfcSceneSavedMenu);
3131
} else {

0 commit comments

Comments
 (0)