fix: panic when a second zip extract dialog is opened

* Syncs extracted zip files on the compio executor's thread
* Close the first zip extract dialog before opening a new one to fix a panic
---------

Co-authored-by: James A DellaMorte <dellamorte.james@comcast.net>
This commit is contained in:
JADella94 2026-06-24 14:12:10 -04:00 • committed by GitHub
parent c653b69c75
commit cd427c746c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 49 additions and 23 deletions

View file

@ -1009,6 +1009,12 @@ impl App {
.and_then(|first| first.as_ref().parent())
.map(Path::to_path_buf)
{
let mut tasks = Vec::new();
if let Some(old_dialog) = self.file_dialog_opt.take() {
let old_id = old_dialog.window_id();
self.windows.remove(&old_id);
tasks.push(window::close(old_id));
}
let (mut dialog, dialog_task) = Dialog::new(
DialogSettings::new()
.kind(DialogKind::OpenFolder)
@ -1025,7 +1031,9 @@ impl App {
))),
);
self.file_dialog_opt = Some(dialog);
Task::batch([set_title_task, dialog_task])
tasks.push(set_title_task);
tasks.push(dialog_task);
Task::batch(tasks)
} else {
Task::none()
}