From a0408f12eb294b322dc4e4c92d1d65ac392c2923 Mon Sep 17 00:00:00 2001 From: Puyodead1 Date: Fri, 22 Dec 2023 17:12:29 -0500 Subject: [PATCH] Update lib.rs --- src-tauri/src/lib.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 13eb4cf..05de965 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -17,11 +17,7 @@ async fn close_splashscreen(window: tauri::Window) { } // Show main window - let main_window = window.get_window("main").unwrap(); - main_window.show().unwrap(); - // Open the dev tools automatically when debugging the application - #[cfg(debug_assertions)] - main_window.open_devtools(); + window.get_window("main").unwrap().show().unwrap(); } } @@ -77,6 +73,12 @@ pub fn run() { tray::create_tray(handle)?; } + // Open the dev tools automatically when debugging the application + #[cfg(debug_assertions)] + if let Some(main_window) = app.get_window("main") { + main_window.open_devtools(); + }; + Ok(()) }) .on_window_event(|event| match event.event() {