Commit 3200ccf4 authored by Jose Blaya's avatar Jose Blaya
Browse files

Get current isPersistentConnection value from Settings vc

parent 6db5ce55
......@@ -281,6 +281,8 @@ class SettingsViewController: AutolayoutViewController {
customDNSSettingsVC.secondaryDNSValue = ips.last
}
}
} else if let trustedNetworksVC = segue.destination as? TrustedNetworksViewController {
trustedNetworksVC.persistentConnectionValue = pendingPreferences.isPersistentConnection
}
}
......
......@@ -22,6 +22,7 @@ class TrustedNetworksViewController: AutolayoutViewController {
private lazy var switchRules = UISwitch()
var shouldReconnectAutomatically = false
var hasUpdatedPreferences = false
var persistentConnectionValue = false
private enum Sections: Int, EnumsBuilder {
......@@ -51,7 +52,7 @@ class TrustedNetworksViewController: AutolayoutViewController {
configureTableView()
if !Client.preferences.isPersistentConnection,
if !persistentConnectionValue,
Client.preferences.nmtRulesEnabled {
presentKillSwitchAlert()
}
......@@ -119,7 +120,8 @@ class TrustedNetworksViewController: AutolayoutViewController {
}
@objc private func toggleRules(_ sender: UISwitch) {
if sender.isOn {
if !persistentConnectionValue,
sender.isOn {
presentKillSwitchAlert()
}
let preferences = Client.preferences.editable()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment