From 1dd96419ab3c82306d5d55c7053117624207ef3e Mon Sep 17 00:00:00 2001 From: its your bedtime <23366927+itsyourbedtime@users.noreply.github.com> Date: Thu, 7 Oct 2021 12:41:30 +0300 Subject: [PATCH] [FL-1917] Archive: fix duplicates in favorites (#749) * Archive: fix last_offset usage when switching to another tab * fix the fix --- applications/archive/helpers/archive_browser.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/applications/archive/helpers/archive_browser.c b/applications/archive/helpers/archive_browser.c index 19907984..5dec45b5 100644 --- a/applications/archive/helpers/archive_browser.c +++ b/applications/archive/helpers/archive_browser.c @@ -10,7 +10,9 @@ void archive_update_offset(ArchiveBrowserView* browser) { if(array_size > 3 && model->idx >= array_size - 1) { model->list_offset = model->idx - 3; - } else if(model->last_offset && model->last_offset != model->list_offset) { + } else if( + model->last_offset && model->last_offset != model->list_offset && + model->tab_idx == model->last_tab) { model->list_offset = model->last_offset; model->last_offset = !model->last_offset; } else if(model->list_offset < model->idx - bounds) { @@ -18,7 +20,6 @@ void archive_update_offset(ArchiveBrowserView* browser) { } else if(model->list_offset > model->idx - bounds) { model->list_offset = CLAMP(model->idx - 1, array_size - bounds, 0); } - return true; }); }