🐛 Close optimization for non-Mac systems
This commit is contained in:
@@ -55,7 +55,13 @@ pub fn run_app() {
|
|||||||
})
|
})
|
||||||
.on_window_event(|event| {
|
.on_window_event(|event| {
|
||||||
if let tauri::WindowEvent::CloseRequested { api, .. } = event.event() {
|
if let tauri::WindowEvent::CloseRequested { api, .. } = event.event() {
|
||||||
|
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
event.window().minimize().unwrap();
|
event.window().minimize().unwrap();
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
event.window().hide().unwrap();
|
||||||
|
|
||||||
api.prevent_close();
|
api.prevent_close();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user