Archive fix sort idx=0 + hide cursor while loading

This commit is contained in:
Willy-JL
2023-07-03 03:05:17 +02:00
parent 0ccdc60921
commit cdfdbed730
@@ -28,7 +28,7 @@ static void
{
files_array_reset(model->files);
model->item_cnt = item_cnt;
model->item_idx = (file_idx > 0) ? file_idx : 0;
model->item_idx = file_idx;
load_offset =
CLAMP(model->item_idx - FILE_LIST_BUF_LEN / 2, (int32_t)model->item_cnt, 0);
model->array_offset = 0;
@@ -76,7 +76,7 @@ static void archive_list_item_cb(
{
if(model->item_cnt <= BROWSER_SORT_THRESHOLD) {
FuriString* selected = NULL;
if(model->item_idx > 0) {
if(model->item_idx >= 0) {
selected = furi_string_alloc_set(
files_array_get(model->files, model->item_idx)->path);
}
@@ -91,6 +91,10 @@ static void archive_list_item_cb(
}
}
}
if(model->item_idx < 0) {
model->item_idx = 0;
}
}
model->list_loading = false;
},