fix: windows cannot save window state

This commit is contained in:
huzibaca 2024-11-19 23:32:32 +08:00
parent 5b0ff01cbf
commit 94259f9515
No known key found for this signature in database
GPG Key ID: D4364EE4851DC302
2 changed files with 1 additions and 3 deletions

View File

@ -124,6 +124,7 @@ pub fn quit(code: Option<i32>) {
resolve::restore_public_dns().await;
});
log_err!(app_handle.save_window_state(StateFlags::default()));
app_handle.exit(code.unwrap_or(0));
}

View File

@ -9,7 +9,6 @@ use crate::core::hotkey;
use crate::utils::{resolve, resolve::resolve_scheme, server};
#[cfg(target_os = "macos")]
use tauri::Listener;
use tauri_plugin_window_state::{AppHandleExt, StateFlags};
pub fn run() {
// 单例检测
@ -147,8 +146,6 @@ pub fn run() {
api.prevent_exit();
return;
}
let app_hanele = core::handle::Handle::global().app_handle().unwrap();
let _ = app_hanele.save_window_state(StateFlags::default());
}
tauri::RunEvent::WindowEvent { label, event, .. } => {
if label == "main" {