fix(web): warn before losing unsaved changes

Closes #556
This commit is contained in:
Hakan Seven committed 2026-07-29 22:42:04 +03:00
1 parent 7b708372a8
commit 5f0e1732c1
4 files changed
+46

No files matched your search

+2
View File
@@ -3178,6 +3178,8 @@ pub fn run() -> iced::Result {
impl Drop for OpenCADStudio {
fn drop(&mut self) {
#[cfg(target_arch = "wasm32")]
crate::sys::set_unsaved_changes_warning(false);
// Kill plugin runner processes as soon as the application state is
// dropped, instead of waiting for the thread-local manager destructor.
// This makes host shutdown deterministic and fast on every exit path.
+2
View File
@@ -217,6 +217,8 @@ impl OpenCADStudio {
);
}
}
#[cfg(target_arch = "wasm32")]
crate::sys::set_unsaved_changes_warning(self.tabs.iter().any(|tab| tab.dirty));
task
}