diff --git a/applications/main/archive/helpers/archive_browser.c b/applications/main/archive/helpers/archive_browser.c index facf00a3a..520741fe2 100644 --- a/applications/main/archive/helpers/archive_browser.c +++ b/applications/main/archive/helpers/archive_browser.c @@ -153,7 +153,9 @@ void archive_update_focus(ArchiveBrowserView* browser, const char* target) { archive_get_items(browser, furi_string_get_cstr(browser->path)); - if(!archive_file_get_array_size(browser) && archive_is_home(browser)) { + ArchiveTabEnum tab = archive_get_tab(browser); + if(!archive_file_get_array_size(browser) && archive_is_home(browser) && + (tab != ArchiveTabBrowser)) { archive_switch_tab(browser, TAB_LEFT); } else { with_view_model( @@ -220,7 +222,8 @@ void archive_file_array_rm_selected(ArchiveBrowserView* browser) { }, false); - if((items_cnt == 0) && (archive_is_home(browser))) { + ArchiveTabEnum tab = archive_get_tab(browser); + if((items_cnt == 0) && (archive_is_home(browser)) && (tab != ArchiveTabBrowser)) { archive_switch_tab(browser, TAB_LEFT); } diff --git a/applications/main/archive/views/archive_browser_view.c b/applications/main/archive/views/archive_browser_view.c index e298583ec..de3aa8887 100644 --- a/applications/main/archive/views/archive_browser_view.c +++ b/applications/main/archive/views/archive_browser_view.c @@ -585,6 +585,10 @@ static bool archive_view_input(InputEvent* event, void* context) { ((model->item_idx - scroll_speed) + model->item_cnt) % model->item_cnt; } + // Fix for empty folders, we can't select -1 item + if(model->item_idx < 0) { + model->item_idx = 0; + } if(is_file_list_load_required(model)) { model->list_loading = true; browser->callback(ArchiveBrowserEventLoadPrevItems, browser->context);