diff --git a/Passepartout/App/iOS/CHANGELOG.md b/Passepartout/App/iOS/CHANGELOG.md index dcc9cbfd..8dcc3784 100644 --- a/Passepartout/App/iOS/CHANGELOG.md +++ b/Passepartout/App/iOS/CHANGELOG.md @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + ## 1.15.1 (2021-02-14) ### Fixed diff --git a/Passepartout/App/macOS/CHANGELOG.md b/Passepartout/App/macOS/CHANGELOG.md index 7a2b74e7..015826fd 100644 --- a/Passepartout/App/macOS/CHANGELOG.md +++ b/Passepartout/App/macOS/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Prevent ineffective editing of trusted network SSID. +- VPN not being disabled when "Inactive" due to trusted network. ## 1.15.1 (2021-02-14) diff --git a/Passepartout/App/macOS/Menu/StatusMenu.swift b/Passepartout/App/macOS/Menu/StatusMenu.swift index c6c43b57..15f3a5fc 100644 --- a/Passepartout/App/macOS/Menu/StatusMenu.swift +++ b/Passepartout/App/macOS/Menu/StatusMenu.swift @@ -421,11 +421,15 @@ class StatusMenu: NSObject { } @objc private func enableVPN() { - vpn.reconnect(completionHandler: nil) + vpn.reconnect { _ in + self.reloadVpnStatus() + } } @objc private func disableVPN() { - vpn.disconnect(completionHandler: nil) + vpn.disconnect { _ in + self.reloadVpnStatus() + } } @objc private func reconnectVPN() { diff --git a/Passepartout/App/macOS/Scenes/Service/ServiceViewController.swift b/Passepartout/App/macOS/Scenes/Service/ServiceViewController.swift index 07417ec3..a4c63cb6 100644 --- a/Passepartout/App/macOS/Scenes/Service/ServiceViewController.swift +++ b/Passepartout/App/macOS/Scenes/Service/ServiceViewController.swift @@ -189,19 +189,20 @@ class ServiceViewController: NSViewController { status = .disconnected } service.activateProfile(profile) - reloadVpnStatus() - switch status { - case .disconnected: + if !vpn.isEnabled { guard !service.needsCredentials(for: uncheckedProfile) else { isPendingConnection = true perform(segue: StoryboardSegue.Service.accountSegueIdentifier) return } - vpn.reconnect(completionHandler: nil) - - default: - vpn.disconnect(completionHandler: nil) + vpn.reconnect { _ in + self.reloadVpnStatus() + } + } else { + vpn.disconnect { _ in + self.reloadVpnStatus() + } } }