TunnelsManager: Don't lose .restarting state

This commit is contained in:
Roopesh Chander 2019-02-08 00:17:05 +05:30
parent 9111b2723f
commit fd40b3adb8
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
}