Skip to content

Commit

Permalink
Archive: Fix item focus after aborting the Delete operation (#3475)
Browse files Browse the repository at this point in the history
Co-authored-by: hedger <[email protected]>
Co-authored-by: あく <[email protected]>
  • Loading branch information
3 people authored Mar 5, 2024
1 parent a6c5a1b commit 5e47048
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions applications/main/archive/scenes/archive_scene_browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ bool archive_scene_browser_on_event(void* context, SceneManagerEvent event) {
break;
case ArchiveBrowserEventFileMenuDelete:
if(archive_get_tab(browser) != ArchiveTabFavorites) {
archive_show_file_menu(browser, false);
scene_manager_set_scene_state(
archive->scene_manager, ArchiveAppSceneBrowser, SCENE_STATE_NEED_REFRESH);
scene_manager_next_scene(archive->scene_manager, ArchiveAppSceneDelete);
Expand Down
6 changes: 6 additions & 0 deletions applications/main/archive/scenes/archive_scene_delete.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ void archive_scene_delete_on_enter(void* context) {
filename = furi_string_alloc();

ArchiveFile_t* current = archive_get_current_file(app->browser);

FuriString* filename_no_ext = furi_string_alloc();
path_extract_filename(current->path, filename_no_ext, true);
strlcpy(app->text_store, furi_string_get_cstr(filename_no_ext), MAX_NAME_LEN);
furi_string_free(filename_no_ext);

path_extract_filename(current->path, filename, false);

char delete_str[64];
Expand Down

0 comments on commit 5e47048

Please sign in to comment.