fix window close bug
This commit is contained in:
parent
6d5bd549c0
commit
9f3a6f5f2f
1 changed files with 4 additions and 2 deletions
|
|
@ -150,10 +150,12 @@ pub fn run() {
|
|||
|
||||
Ok(())
|
||||
})
|
||||
.on_window_event(|app, event| match event {
|
||||
.on_window_event(|window, event| match event {
|
||||
tauri::WindowEvent::CloseRequested { api, .. } => {
|
||||
app.hide().unwrap();
|
||||
api.prevent_close();
|
||||
|
||||
// TODO may be different on windows, this works for macos
|
||||
tauri::AppHandle::hide(window.app_handle()).unwrap();
|
||||
}
|
||||
_ => {}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue