Prepare before disconnection intent
manager is nil otherwise in connect/disconnect. Doesn't apply to reinstall/reconnect.
This commit is contained in:
parent
af51911536
commit
3bf340c74c
|
@ -200,11 +200,15 @@ public class IntentDispatcher {
|
|||
|
||||
public static func handleDisableVPN(_ intent: DisableVPNIntent, interaction: INInteraction?, completionHandler: ((Error?) -> Void)?) {
|
||||
log.info("Disabling VPN...")
|
||||
VPN.shared.disconnect { (error) in
|
||||
|
||||
let vpn = VPN.shared
|
||||
vpn.prepare {
|
||||
vpn.disconnect { (error) in
|
||||
notifyServiceUpdate()
|
||||
completionHandler?(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static func handleCurrentNetwork(trust: Bool, interaction: INInteraction?, completionHandler: ((Error?) -> Void)?) {
|
||||
guard let currentWifi = Utils.currentWifiNetworkName() else {
|
||||
|
|
Loading…
Reference in New Issue