fix: windows cannot save window state(2)

This commit is contained in:
huzibaca
2024-11-20 00:27:53 +08:00
parent 95b7641f9c
commit 98c6e0311b
3 changed files with 16 additions and 0 deletions

View File

@@ -151,6 +151,9 @@ pub fn run() {
if label == "main" {
match event {
tauri::WindowEvent::CloseRequested { api, .. } => {
if core::handle::Handle::global().is_exiting() {
return;
}
println!("closing window...");
api.prevent_close();
let window = core::handle::Handle::global().get_window().unwrap();