Update VPN toggle if disabling while "Inactive"
Due to trusted network.
This commit is contained in:
parent
7b546ed930
commit
ecc4c6f87e
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue