Commit 2d76de73 authored by Jose Blaya's avatar Jose Blaya
Browse files

disconnect onDemand value if user disconnects manually

parent 5dc8b11a
......@@ -86,10 +86,7 @@ public class IKEv2Profile: NetworkExtensionProfile {
}
// prevent reconnection
if Client.preferences.trustCellularData {
self.currentVPN.isOnDemandEnabled = false
}
self.currentVPN.isOnDemandEnabled = false
self.currentVPN.saveToPreferences { (error) in
if let error = error {
callback?(error)
......@@ -130,9 +127,7 @@ public class IKEv2Profile: NetworkExtensionProfile {
public func disable(_ callback: SuccessLibraryCallback?) {
currentVPN.loadFromPreferences { (error) in
self.currentVPN.isEnabled = false
if Client.preferences.trustCellularData {
self.currentVPN.isOnDemandEnabled = false
}
self.currentVPN.isOnDemandEnabled = false
self.currentVPN.saveToPreferences(completionHandler: callback)
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment