fn main() {
let app = tauri::Builder::default()
.invoke_handler(tauri::generate_handler![close_splashscreen])
.build(tauri::generate_context!())
.expect("error while building tauri application");
test(&app);
app.run(|_app_handle, event| match event {
tauri::RunEvent::ExitRequested { api, .. } => {
api.prevent_exit();
}
_ => {}
});
}
fn test(app: &tauri::App) {
let window = app.get_window("main").unwrap();
if !window.is_devtools_open() {
window.open_devtools();
}
}
I tried to get app in the main function.Is it possable to do this outside main?For example,make a function to change menu text in other file?