Skip to content

Commit

Permalink
Keep running after all windows closed
Browse files Browse the repository at this point in the history
  • Loading branch information
terreng committed Oct 26, 2024
1 parent 795c4ff commit 7fcd9e4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@ fn savepath() -> String {
fn main() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![init, saveconfig, quit])
.run(tauri::generate_context!())
.expect("error while running tauri application");
.build(tauri::generate_context!())
.expect("error while building tauri application")
.run(|_app_handle, event| match event {
tauri::RunEvent::ExitRequested { api, .. } => {
api.prevent_exit();
}
_ => {}
});
}

#[tauri::command]
Expand Down

0 comments on commit 7fcd9e4

Please sign in to comment.