mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-22 12:33:11 +00:00
load plugins only when needed, show loading anim
This commit is contained in:
parent
f0a56af7fa
commit
f6e9dcbc01
2 changed files with 13 additions and 2 deletions
|
@ -155,7 +155,7 @@ static void nfc_protocol_support_scene_read_on_enter(NfcApp* instance) {
|
|||
instance->poller = nfc_poller_alloc(instance->nfc, protocol);
|
||||
|
||||
view_dispatcher_switch_to_view(instance->view_dispatcher, NfcViewPopup);
|
||||
nfc_supported_cards_load_cache(instance->nfc_supported_cards);
|
||||
//nfc_supported_cards_load_cache(instance->nfc_supported_cards);
|
||||
|
||||
// Start poller with the appropriate callback
|
||||
nfc_protocol_support[protocol]->scene_read.on_enter(instance);
|
||||
|
|
|
@ -345,7 +345,7 @@ bool nfc_load_file(NfcApp* instance, FuriString* path, bool show_dialog) {
|
|||
furi_assert(path);
|
||||
bool result = false;
|
||||
|
||||
nfc_supported_cards_load_cache(instance->nfc_supported_cards);
|
||||
//nfc_supported_cards_load_cache(instance->nfc_supported_cards);
|
||||
|
||||
FuriString* load_path = furi_string_alloc();
|
||||
if(nfc_has_shadow_file_internal(instance, path)) { //-V1051
|
||||
|
@ -486,6 +486,12 @@ static void nfc_show_initial_scene_for_device(NfcApp* nfc) {
|
|||
prot, NfcProtocolFeatureEmulateFull | NfcProtocolFeatureEmulateUid) ?
|
||||
NfcSceneEmulate :
|
||||
NfcSceneSavedMenu;
|
||||
// Load plugins (parsers) in case if we are in the saved menu
|
||||
if(scene == NfcSceneSavedMenu) {
|
||||
nfc_show_loading_popup(nfc, true);
|
||||
nfc_supported_cards_load_cache(nfc->nfc_supported_cards);
|
||||
nfc_show_loading_popup(nfc, false);
|
||||
}
|
||||
scene_manager_next_scene(nfc->scene_manager, scene);
|
||||
}
|
||||
|
||||
|
@ -516,6 +522,11 @@ int32_t nfc_app(void* p) {
|
|||
} else {
|
||||
view_dispatcher_attach_to_gui(
|
||||
nfc->view_dispatcher, nfc->gui, ViewDispatcherTypeFullscreen);
|
||||
// Load plugins (parsers) one time in case if we running app normally
|
||||
nfc_show_loading_popup(nfc, true);
|
||||
nfc_supported_cards_load_cache(nfc->nfc_supported_cards);
|
||||
nfc_show_loading_popup(nfc, false);
|
||||
// Switch to the initial scene
|
||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneStart);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue