chore: remove useless hooks

the window is not closed, it is minimized, so the position still exists
This commit is contained in:
huzibaca 2024-10-30 10:06:54 +08:00
parent 7550c2321c
commit dce72a16f0
No known key found for this signature in database
GPG Key ID: D4364EE4851DC302
2 changed files with 2 additions and 5 deletions

View File

@ -6,7 +6,7 @@ use crate::{
};
use anyhow::{anyhow, Result};
use once_cell::sync::OnceCell;
use std::{env::temp_dir, path::PathBuf};
use std::path::PathBuf;
pub const RUNTIME_CONFIG: &str = "clash-verge.yaml";
pub const CHECK_CONFIG: &str = "clash-verge-check.yaml";

View File

@ -143,13 +143,10 @@ pub fn run() {
match event {
tauri::WindowEvent::CloseRequested { api, .. } => {
println!("closing window...");
let _ = resolve::save_window_size_position(true);
api.prevent_close();
let window = core::handle::Handle::global().get_window().unwrap();
log_err!(window.minimize());
let _ = resolve::save_window_size_position(true);
}
tauri::WindowEvent::Moved(_) | tauri::WindowEvent::Resized(_) => {
let _ = resolve::save_window_size_position(false);
}
tauri::WindowEvent::Focused(true) => {
#[cfg(target_os = "macos")]