aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/Tunnel/TunnelsManager.swift
diff options
context:
space:
mode:
Diffstat (limited to 'WireGuard/WireGuard/Tunnel/TunnelsManager.swift')
-rw-r--r--WireGuard/WireGuard/Tunnel/TunnelsManager.swift7
1 files changed, 7 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift
index 5e6ad5c1..d65814bd 100644
--- a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift
+++ b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift
@@ -234,6 +234,13 @@ class TunnelsManager {
return tunnels.first { $0.status == .waiting }
}
+ func tunnelInOperation() -> TunnelContainer? {
+ if let waitingTunnelObject = waitingTunnel() {
+ return waitingTunnelObject
+ }
+ return tunnels.first { $0.status != .inactive }
+ }
+
func startActivation(of tunnel: TunnelContainer) {
guard tunnels.contains(tunnel) else { return } // Ensure it's not deleted
guard tunnel.status == .inactive else {