@@ -22,19 +22,25 @@ fn main() {
2222
2323 tauri:: async_runtime:: spawn ( async move {
2424 while let Some ( event) = rx. recv ( ) . await {
25- if let CommandEvent :: Stdout ( line) = event {
26- if line. contains ( "tauri-server-port=" ) {
27- let tokens: Vec < & str > = line. split ( "=" ) . collect ( ) ;
28- let port_token = tokens[ 1 ] . to_string ( ) ;
29- let port = port_token. trim ( ) ;
30- // println!("window.location.replace(window.location.href + '?sessionURL=ws://localhost:{}/ws')", port);
31- let _ = main_window. eval ( & format ! ( "window.location.replace(window.location.href + '?sessionURL=ws://localhost:{}/ws')" , port) ) ;
32- }
33- if line. contains ( "tauri-client-ready" ) {
34- task:: sleep ( Duration :: from_secs ( 2 ) ) . await ;
35- splashscreen_window. close ( ) . unwrap ( ) ;
36- main_window. show ( ) . unwrap ( ) ;
37- }
25+ match event {
26+ CommandEvent :: Stdout ( line) => {
27+ if line. contains ( "tauri-server-port=" ) {
28+ let tokens: Vec < & str > = line. split ( "=" ) . collect ( ) ;
29+ let port_token = tokens[ 1 ] . to_string ( ) ;
30+ let port = port_token. trim ( ) ;
31+ // println!("window.location.replace(window.location.href + '?sessionURL=ws://localhost:{}/ws')", port);
32+ let _ = main_window. eval ( & format ! ( "window.location.replace(window.location.href + '?sessionURL=ws://localhost:{}/ws')" , port) ) ;
33+ }
34+ if line. contains ( "tauri-client-ready" ) {
35+ task:: sleep ( Duration :: from_secs ( 2 ) ) . await ;
36+ splashscreen_window. close ( ) . unwrap ( ) ;
37+ }
38+ } ,
39+ CommandEvent :: Stderr ( line) => {
40+ // Handle stderr output
41+ println ! ( "Stderr: {}" , line) ;
42+ } ,
43+ _ => { } ,
3844 }
3945 }
4046 } ) ;
0 commit comments