mirror of
https://github.com/Xevion/factorio-achievements-fixer.git
synced 2025-12-10 06:07:10 -06:00
Separate app main runner, disabled app close request prevention
This commit is contained in:
@@ -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();
|
||||
// }
|
||||
_ => {}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user