UI: When deactivating for activating another tunnel, disable on-demand
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
parent
abaf1f1454
commit
a261d84fc6
|
@ -419,8 +419,18 @@ class TunnelsManager {
|
||||||
tunnel.status = .waiting
|
tunnel.status = .waiting
|
||||||
activateWaitingTunnelOnDeactivation(of: tunnelInOperation)
|
activateWaitingTunnelOnDeactivation(of: tunnelInOperation)
|
||||||
if tunnelInOperation.status != .deactivating {
|
if tunnelInOperation.status != .deactivating {
|
||||||
|
if tunnelInOperation.isActivateOnDemandEnabled {
|
||||||
|
setOnDemandEnabled(false, on: tunnelInOperation) { [weak self] error in
|
||||||
|
guard error == nil else {
|
||||||
|
wg_log(.error, message: "Unable to activate tunnel '\(tunnel.name)' because on-demand could not be disabled on active tunnel '\(tunnel.name)'")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
self?.startDeactivation(of: tunnelInOperation)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
startDeactivation(of: tunnelInOperation)
|
startDeactivation(of: tunnelInOperation)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue