Migrate when we notice a new tunnel in reload()

This commit is contained in:
Roopesh Chander 2019-02-12 17:43:40 +05:30
parent 078780a3ba
commit 70923d9c87
1 changed files with 5 additions and 0 deletions

View File

@ -83,6 +83,11 @@ class TunnelsManager {
matchingTunnel.refreshStatus()
} else {
// Tunnel was added outside the app
if let proto = loadedTunnelProvider.protocolConfiguration as? NETunnelProviderProtocol {
if proto.migrateConfigurationIfNeeded(called: loadedTunnelProvider.localizedDescription ?? "unknown") {
loadedTunnelProvider.saveToPreferences { _ in }
}
}
let tunnel = TunnelContainer(tunnel: loadedTunnelProvider)
self.tunnels.append(tunnel)
self.tunnels.sort { $0.name < $1.name }