Commit 82f22acb authored by Jose Blaya's avatar Jose Blaya
Browse files

Refactor

parent 4cb1414b
......@@ -621,12 +621,12 @@ class SettingsViewController: AutolayoutViewController {
@objc private func redisplaySettings() {
var sections = SettingsViewController.allSections
if !Flags.shared.enablesProtocolSelection {
sections.remove(at: sections.index(of: .connection)!)
sections.remove(at: sections.index(of: .encryption)!)
sections.remove(at: sections.firstIndex(of: .connection)!)
sections.remove(at: sections.firstIndex(of: .encryption)!)
} else {
if (pendingPreferences.vpnType == IPSecProfile.vpnType ||
pendingPreferences.vpnType == IKEv2Profile.vpnType) {
sections.remove(at: sections.index(of: .encryption)!)
sections.remove(at: sections.firstIndex(of: .encryption)!)
}
}
if Flags.shared.enablesMACESetting {
......@@ -647,13 +647,13 @@ class SettingsViewController: AutolayoutViewController {
}
if !Flags.shared.enablesContentBlockerSetting {
sections.remove(at: sections.index(of: .contentBlocker)!)
sections.remove(at: sections.firstIndex(of: .contentBlocker)!)
}
if (pendingPreferences.vpnType != PIATunnelProfile.vpnType) {
sections.remove(at: sections.index(of: .applicationInformation)!)
sections.remove(at: sections.firstIndex(of: .applicationInformation)!)
}
if !Flags.shared.enablesResetSettings {
sections.remove(at: sections.index(of: .reset)!)
sections.remove(at: sections.firstIndex(of: .reset)!)
}
if Flags.shared.enablesDevelopmentSettings {
sections.append(.development)
......
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