aboutsummaryrefslogtreecommitdiffstats
path: root/Sources/WireGuardApp/Tunnel/ActivateOnDemandOption.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2021-09-27 16:07:20 +0530
committerRoopesh Chander <roop@roopc.net>2021-09-28 00:16:35 +0530
commit23618f994f17d8ad8f2f65d79b4a1e8a0830b334 (patch)
tree92fd54700293172987609489281614485e11d88f /Sources/WireGuardApp/Tunnel/ActivateOnDemandOption.swift
parentUI: When saving on-demand rules on a config, enable on-demand if active (diff)
downloadwireguard-apple-master.tar.xz
wireguard-apple-master.zip
UI: When saving on-demand rules, deactivate if reqd and then saveHEADmaster
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'Sources/WireGuardApp/Tunnel/ActivateOnDemandOption.swift')
-rw-r--r--Sources/WireGuardApp/Tunnel/ActivateOnDemandOption.swift4
1 files changed, 1 insertions, 3 deletions
diff --git a/Sources/WireGuardApp/Tunnel/ActivateOnDemandOption.swift b/Sources/WireGuardApp/Tunnel/ActivateOnDemandOption.swift
index 9ba605a..9697ce6 100644
--- a/Sources/WireGuardApp/Tunnel/ActivateOnDemandOption.swift
+++ b/Sources/WireGuardApp/Tunnel/ActivateOnDemandOption.swift
@@ -42,9 +42,7 @@ extension ActivateOnDemandOption {
}
}
tunnelProviderManager.onDemandRules = rules
- let status = tunnelProviderManager.connection.status
- let isActive = status == .connected || status == .connecting
- tunnelProviderManager.isOnDemandEnabled = (rules != nil) && (tunnelProviderManager.isOnDemandEnabled || isActive)
+ tunnelProviderManager.isOnDemandEnabled = (rules != nil) && tunnelProviderManager.isOnDemandEnabled
}
init(from tunnelProviderManager: NETunnelProviderManager) {