Skip to content

Commit

Permalink
fix apps loading logic
Browse files Browse the repository at this point in the history
  • Loading branch information
xMasterX committed Apr 5, 2024
1 parent 1e324a7 commit 344b624
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions applications/services/desktop/scenes/desktop_scene_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,15 @@ static inline bool desktop_scene_main_check_none(const char* str) {
static void desktop_scene_main_open_app_or_profile(Desktop* desktop, FavoriteApp* application) {
bool load_ok = false;
if(strlen(application->name_or_path) > 0) {
if(desktop_scene_main_check_none(application->name_or_path)) {
// skip loading
load_ok = true;
} else if(
loader_start(desktop->loader, application->name_or_path, NULL, NULL) ==
LoaderStatusOk) {
load_ok = true;
if(!desktop_scene_main_check_none(application->name_or_path)) {
// Load app
loader_start_detached_with_gui_error(desktop->loader, application->name_or_path, NULL);
}
load_ok = true;
}
// In case of "default" setting
if(!load_ok) {
loader_start(desktop->loader, "Passport", NULL, NULL);
loader_start_detached_with_gui_error(desktop->loader, "Passport", NULL);
}
}

Expand All @@ -88,7 +86,7 @@ static void desktop_scene_main_start_favorite(Desktop* desktop, FavoriteApp* app
loader_start_detached_with_gui_error(desktop->loader, application->name_or_path, NULL);
}
} else {
loader_start(desktop->loader, LOADER_APPLICATIONS_NAME, NULL, NULL);
loader_start_detached_with_gui_error(desktop->loader, LOADER_APPLICATIONS_NAME, NULL);
}
}

Expand Down

0 comments on commit 344b624

Please sign in to comment.