diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 2388b6a..49df870 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -3,7 +3,7 @@ mod format; #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { - tauri::Builder::default() + let app = tauri::Builder::default() .plugin(tauri_plugin_fs::init()) .plugin(tauri_plugin_dialog::init()) .plugin(tauri_plugin_shell::init()) @@ -11,6 +11,23 @@ pub fn run() { dirs::find_save_files, dirs::choose_best_save_directory, ]) - .run(tauri::generate_context!()) - .expect("error while running tauri application"); + // .on_window_event(|_window, event| { + // use tauri::WindowEvent; + // match event { + // WindowEvent::CloseRequested { api, .. } => { + // api.prevent_close(); + // } + // _ => {} + // } + // }) + .build(tauri::generate_context!()) + .expect("error while building tauri application"); + + app.run(|_app_handle, event| match event { + // tauri::RunEvent::ExitRequested { api, .. } => { + // println!("Exit requested"); + // api.prevent_exit(); + // } + _ => {} + }); }