File tree Expand file tree Collapse file tree 3 files changed +22
-23
lines changed
Expand file tree Collapse file tree 3 files changed +22
-23
lines changed Original file line number Diff line number Diff line change @@ -786,13 +786,13 @@ impl App {
786786 break ;
787787 }
788788
789- if let Ok ( active) = vpn_manager. get_active_vpns ( ) . await {
790- if active. iter ( ) . any ( |( name, _) | name != & profile_name) {
791- let _ = event_tx . send ( AppEvent :: Notification ( "Another active VPN detected during stabilization. Ensuring exclusivity..." . to_string ( ) ) ) . await ;
792- for ( name , _ ) in active {
793- if name != profile_name {
794- let _ = vpn_manager . disconnect ( & name ) . await ;
795- }
789+ if let Ok ( active) = vpn_manager. get_active_vpns ( ) . await
790+ && active. iter ( ) . any ( |( name, _) | name != & profile_name)
791+ {
792+ let _ = event_tx . send ( AppEvent :: Notification ( "Another active VPN detected during stabilization. Ensuring exclusivity..." . to_string ( ) ) ) . await ;
793+ for ( name, _ ) in active {
794+ if name != profile_name {
795+ let _ = vpn_manager . disconnect ( & name ) . await ;
796796 }
797797 }
798798 }
Original file line number Diff line number Diff line change @@ -398,12 +398,12 @@ async fn cmd_connect(name: String) -> Result<()> {
398398 }
399399
400400 // ensure no other VPN is active
401- if let Ok ( active) = mgr. get_active_vpns ( ) . await {
402- if active. iter ( ) . any ( |( name, _) | name != & profile_name) {
403- for ( name , _ ) in active {
404- if name != profile_name {
405- let _ = mgr . disconnect ( & name ) . await ;
406- }
401+ if let Ok ( active) = mgr. get_active_vpns ( ) . await
402+ && active. iter ( ) . any ( |( name, _) | name != & profile_name)
403+ {
404+ for ( name, _ ) in active {
405+ if name != profile_name {
406+ let _ = mgr . disconnect ( & name ) . await ;
407407 }
408408 }
409409 }
Original file line number Diff line number Diff line change @@ -91,21 +91,20 @@ impl Config {
9191 let mut imported_any = false ;
9292
9393 // Import from default import dir
94- if let Ok ( import_dir) = Self :: import_dir ( ) {
95- if self . import_from_dir ( & import_dir) ? {
96- imported_any = true ;
97- }
94+ if let Ok ( import_dir) = Self :: import_dir ( )
95+ && self . import_from_dir ( & import_dir) ?
96+ {
97+ imported_any = true ;
9898 }
9999
100100 // Import from Azure VPN Client dir on macOS
101101 #[ cfg( target_os = "macos" ) ]
102102 {
103- if let Ok ( azure_dir) = Self :: azure_vpn_import_dir ( ) {
104- if azure_dir. exists ( ) {
105- if self . import_from_dir ( & azure_dir) ? {
106- imported_any = true ;
107- }
108- }
103+ if let Ok ( azure_dir) = Self :: azure_vpn_import_dir ( )
104+ && azure_dir. exists ( )
105+ && self . import_from_dir ( & azure_dir) ?
106+ {
107+ imported_any = true ;
109108 }
110109 }
111110
You can’t perform that action at this time.
0 commit comments