Skip to content

Commit

Permalink
APPLE: fix logout disconnect not working (#1734)
Browse files Browse the repository at this point in the history
  • Loading branch information
rokas-ambrazevicius authored Dec 6, 2024
1 parent 77177f7 commit f58ad74
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public final class ConnectionManager: ObservableObject {
}
}
#endif
@Published public var currentTunnelStatus: TunnelStatus? {
@Published public var currentTunnelStatus: TunnelStatus = .disconnected {
didSet {
updateTunnelStatusIfReconnecting()
updateTunnelStatusIfDisconnecting()
Expand Down Expand Up @@ -190,16 +190,18 @@ public final class ConnectionManager: ObservableObject {
}
}
#endif


/// Disconnects tunnel if connected.
/// iOS removes tunnel profile.
public func disconnectBeforeLogout() async {
guard currentTunnelStatus != .disconnected else { return }
#if os(iOS)
disconnectActiveTunnel()
await waitForTunnelStatus(with: .disconnected)
resetVpnProfile()
#elseif os(macOS)
grpcManager.disconnect()
await waitForTunnelStatus(with: .disconnected)
#endif
await waitForTunnelStatus(with: .disconnected)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public final class CredentialsManager {
#if os(iOS)
let dataFolderURL = try dataFolderURL()
try forgetAccount(path: dataFolderURL.path())
// TODO: remove tunnel
#endif

#if os(macOS)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

public enum AppVersionProvider {
public static let libVersion = "1.1.0-dev-1"
public static let libVersion = "1.1.0-dev"

public static var app: String {
"nym-vpn-app"
Expand Down

0 comments on commit f58ad74

Please sign in to comment.