TunnelsManager: Don't lose .restarting state

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander 2019-02-08 00:17:05 +05:30
parent 1f3ec042e0
commit ecd66defe5
1 changed files with 5 additions and 4 deletions

View File

@ -336,10 +336,8 @@ class TunnelsManager {
}
}
if (tunnel.status == .restarting) && (session.status == .disconnected || session.status == .disconnecting) {
if session.status == .disconnected {
tunnel.startActivation(activationDelegate: self.activationDelegate)
}
if tunnel.status == .restarting && session.status == .disconnected {
tunnel.startActivation(activationDelegate: self.activationDelegate)
return
}
@ -442,6 +440,9 @@ class TunnelContainer: NSObject {
}
func refreshStatus() {
if (status == .restarting) && (tunnelProvider.connection.status == .disconnected || tunnelProvider.connection.status == .disconnecting) {
return
}
status = TunnelStatus(from: tunnelProvider.connection.status)
isActivateOnDemandEnabled = tunnelProvider.isOnDemandEnabled
}