File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ use tauri::Config;
66
77const IS_DEV : bool = tauri:: is_dev ( ) ;
88
9+ const WINDOW_NAME : & str = "main" ;
10+
911#[ derive( Serialize , Deserialize , Debug ) ]
1012struct Clock {
1113 #[ serde( default ) ]
@@ -161,7 +163,7 @@ pub fn run() {
161163 let mut tbr = tauri:: Builder :: default ( ) ;
162164 if IS_DEV {
163165 tbr = tbr. setup ( |app| {
164- let _window = app. get_webview_window ( "main" ) . unwrap ( ) ;
166+ let _window = app. get_webview_window ( WINDOW_NAME ) . unwrap ( ) ;
165167 #[ cfg( debug_assertions) ]
166168 {
167169 _window. open_devtools ( ) ;
@@ -171,8 +173,8 @@ pub fn run() {
171173 } else {
172174 tbr = tbr. plugin ( tauri_plugin_single_instance:: init ( |_app, _args, _cwd| {
173175 let _ = _app
174- . get_webview_window ( "main" )
175- . expect ( "execute only main window" )
176+ . get_webview_window ( WINDOW_NAME )
177+ . expect ( & format ! ( "execute only {} window" , WINDOW_NAME ) )
176178 . set_focus ( ) ;
177179 } ) )
178180 }
You can’t perform that action at this time.
0 commit comments