@@ -206,7 +206,7 @@ impl AppState {
206206 let e = "no address ip found" ;
207207
208208 error ! ( "failed to start audio stream: {e}" ) ;
209- return self . add_log ( & e . to_string ( ) ) ;
209+ return self . add_log ( e ) ;
210210 } ;
211211
212212 ConnectOption :: Tcp { ip }
@@ -216,7 +216,7 @@ impl AppState {
216216 let e = "no address ip found" ;
217217
218218 error ! ( "failed to start audio stream: {e}" ) ;
219- return self . add_log ( & e . to_string ( ) ) ;
219+ return self . add_log ( e ) ;
220220 } ;
221221 ConnectOption :: Udp { ip }
222222 }
@@ -466,7 +466,7 @@ impl Application for AppState {
466466 return self . add_log ( format ! ( "Listening on `{ip}:{port}`" ) . as_str ( ) ) ;
467467 }
468468 }
469- StreamerMsg :: Connected { ip, port } => {
469+ StreamerMsg :: Connected { ip, port, mode } => {
470470 if let Some ( system_tray) = self . system_tray . as_mut ( ) {
471471 system_tray. update_menu_state ( false , & fl ! ( "state_connected" ) ) ;
472472 }
@@ -477,15 +477,18 @@ impl Application for AppState {
477477 ip. unwrap_or( IpAddr :: V4 ( Ipv4Addr :: UNSPECIFIED ) ) ,
478478 port. unwrap_or_default( )
479479 ) ;
480- // show notification when app is minimized
481- let _ = Notification :: new ( )
482- . summary ( "AndroidMic" )
483- . body ( format ! ( "Connected on {address}" ) . as_str ( ) )
484- . auto_icon ( )
485- . show ( )
486- . map_err ( |e| {
487- error ! ( "failed to show notification: {e}" ) ;
488- } ) ;
480+
481+ if mode != ConnectionMode :: Udp {
482+ // show notification when app is minimized
483+ let _ = Notification :: new ( )
484+ . summary ( "AndroidMic" )
485+ . body ( format ! ( "Connected on {address}" ) . as_str ( ) )
486+ . auto_icon ( )
487+ . show ( )
488+ . map_err ( |e| {
489+ error ! ( "failed to show notification: {e}" ) ;
490+ } ) ;
491+ }
489492 }
490493
491494 self . connection_state = ConnectionState :: Connected ;
@@ -701,7 +704,7 @@ impl Application for AppState {
701704 self . about_window = None ;
702705 }
703706
704- if !self . has_shown_minimize_notification {
707+ if !self . config . data ( ) . start_minimized && ! self . has_shown_minimize_notification {
705708 let _ = Notification :: new ( )
706709 . summary ( "AndroidMic" )
707710 . body ( & fl ! ( "minimized_to_tray" ) )
0 commit comments