From 015350c6928e60ee3c8260308a90989bb9c1c6d1 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Thu, 13 Jul 2023 23:22:55 +0300 Subject: [PATCH] fix --- applications/services/desktop/scenes/desktop_scene_main.c | 3 ++- .../scenes/desktop_settings_scene_favorite.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/applications/services/desktop/scenes/desktop_scene_main.c b/applications/services/desktop/scenes/desktop_scene_main.c index d92948d0c..1de8a3cd8 100644 --- a/applications/services/desktop/scenes/desktop_scene_main.c +++ b/applications/services/desktop/scenes/desktop_scene_main.c @@ -72,7 +72,8 @@ static void desktop_scene_main_open_app_or_profile(Desktop* desktop, const char* static void desktop_scene_main_start_favorite(Desktop* desktop, FavoriteApp* application) { if(strlen(application->name_or_path) > 2) { loader_start_with_gui_error(desktop->loader, application->name_or_path, NULL); - } else if(strlen(application->name_or_path) < 2) { + } else if( + (strlen(application->name_or_path) < 2) && (strcmp(application->name_or_path, "d") != 0)) { loader_start(desktop->loader, LOADER_APPLICATIONS_NAME, NULL, NULL); } } diff --git a/applications/settings/desktop_settings/scenes/desktop_settings_scene_favorite.c b/applications/settings/desktop_settings/scenes/desktop_settings_scene_favorite.c index 33dd305ae..90b5d6cfe 100644 --- a/applications/settings/desktop_settings/scenes/desktop_settings_scene_favorite.c +++ b/applications/settings/desktop_settings/scenes/desktop_settings_scene_favorite.c @@ -13,7 +13,7 @@ #define EXTERNAL_APPLICATION_NAME ("[External Application]") #define EXTERNAL_APPLICATION_INDEX (APPS_COUNT + 2) -#define NONE_APPLICATION_INDEX (FLIPPER_APPS_COUNT + 3) +#define NONE_APPLICATION_INDEX (APPS_COUNT + 3) #define PRESELECTED_SPECIAL 0xffffffff @@ -181,7 +181,9 @@ bool desktop_settings_scene_favorite_on_event(void* context, SceneManagerEvent e consumed = true; } } else if(event.event == NONE_APPLICATION_INDEX) { - strncpy(curr_favorite_app->name_or_path, "n", MAX_APP_LENGTH); + // Clear favorite app path and set it to "d" (disabled) + memset(curr_favorite_app->name_or_path, 0, strlen(curr_favorite_app->name_or_path)); + strncpy(curr_favorite_app->name_or_path, "d", MAX_APP_LENGTH); consumed = true; } else { const char* name = favorite_fap_get_app_name(event.event);