🐛 Close optimization for non-Mac systems

This commit is contained in:
Tw93
2023-04-22 22:56:16 +08:00
parent 2a0280f046
commit 8e36531df1

View File

@@ -55,7 +55,13 @@ pub fn run_app() {
})
.on_window_event(|event| {
if let tauri::WindowEvent::CloseRequested { api, .. } = event.event() {
#[cfg(target_os = "macos")]
event.window().minimize().unwrap();
#[cfg(not(target_os = "macos"))]
event.window().hide().unwrap();
api.prevent_close();
}
})