mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
fix: windows cannot save window state(2)
This commit is contained in:
@@ -118,12 +118,14 @@ pub fn toggle_tun_mode() {
|
||||
|
||||
pub fn quit(code: Option<i32>) {
|
||||
let app_handle = handle::Handle::global().app_handle().unwrap();
|
||||
handle::Handle::global().set_is_exiting();
|
||||
resolve::resolve_reset();
|
||||
#[cfg(target_os = "macos")]
|
||||
tauri::async_runtime::block_on(async {
|
||||
resolve::restore_public_dns().await;
|
||||
});
|
||||
|
||||
log_err!(handle::Handle::global().get_window().unwrap().close());
|
||||
log_err!(app_handle.save_window_state(StateFlags::default()));
|
||||
app_handle.exit(code.unwrap_or(0));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user