From 9d9cf274608c59fd59bc19a1785df78ef273beae Mon Sep 17 00:00:00 2001 From: huzibaca Date: Tue, 12 Nov 2024 22:49:08 +0800 Subject: [PATCH] fix: application restart, window status not saved --- src-tauri/src/feat.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src-tauri/src/feat.rs b/src-tauri/src/feat.rs index 9374e2a..4899268 100644 --- a/src-tauri/src/feat.rs +++ b/src-tauri/src/feat.rs @@ -15,6 +15,7 @@ use serde_yaml::{Mapping, Value}; use std::fs; use tauri::Manager; use tauri_plugin_clipboard_manager::ClipboardExt; +use tauri_plugin_window_state::{AppHandleExt, StateFlags}; // 打开面板 pub fn open_or_close_dashboard() { @@ -51,6 +52,7 @@ pub fn restart_app() { resolve::resolve_reset(); let app_handle = handle::Handle::global().app_handle().unwrap(); std::thread::sleep(std::time::Duration::from_secs(1)); + let _ = app_handle.save_window_state(StateFlags::default()); tauri::process::restart(&app_handle.env()); }); }