diff --git a/applications/services/desktop/scenes/desktop_scene_main.c b/applications/services/desktop/scenes/desktop_scene_main.c index 955d64fe2..41b1c3e75 100644 --- a/applications/services/desktop/scenes/desktop_scene_main.c +++ b/applications/services/desktop/scenes/desktop_scene_main.c @@ -62,7 +62,6 @@ static void #endif static void desktop_scene_main_open_app_or_profile(Desktop* desktop, FavoriteApp* application) { - bool load_ok = false; if(strlen(application->name_or_path) > 0) { loader_start_detached_with_gui_error(desktop->loader, application->name_or_path, NULL); } else { @@ -72,7 +71,7 @@ static void desktop_scene_main_open_app_or_profile(Desktop* desktop, FavoriteApp static void desktop_scene_main_start_favorite(Desktop* desktop, FavoriteApp* application) { if(strlen(application->name_or_path) > 0) { - loader_start_detached_with_gui_error(desktop->loader, application->name_or_path); + loader_start_detached_with_gui_error(desktop->loader, application->name_or_path, NULL); } else { loader_start_detached_with_gui_error(desktop->loader, LOADER_APPLICATIONS_NAME, NULL); } diff --git a/applications/services/loader/loader.c b/applications/services/loader/loader.c index c552b5776..8221f4eb0 100644 --- a/applications/services/loader/loader.c +++ b/applications/services/loader/loader.c @@ -47,7 +47,13 @@ LoaderStatus return result.value; } -static void loader_show_gui_error(LoaderStatus status, FuriString* error_message) { +LoaderStatus loader_start_with_gui_error(Loader* loader, const char* name, const char* args) { + furi_check(loader); + furi_check(name); + + FuriString* error_message = furi_string_alloc(); + LoaderStatus status = loader_start(loader, name, args, error_message); + if(status == LoaderStatusErrorUnknownApp && loader_find_external_application_by_name(name) != NULL) { // Special case for external apps @@ -81,15 +87,7 @@ static void loader_show_gui_error(LoaderStatus status, FuriString* error_message dialog_message_free(message); furi_record_close(RECORD_DIALOGS); } -} -LoaderStatus loader_start_with_gui_error(Loader* loader, const char* name, const char* args) { - furi_check(loader); - furi_check(name); - - FuriString* error_message = furi_string_alloc(); - LoaderStatus status = loader_start(loader, name, args, error_message); - loader_show_gui_error(status, error_message); furi_string_free(error_message); return status; }