mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-01-17 22:19:08 +00:00
Simplify commit of network settings
This commit is contained in:
parent
60b60646d4
commit
1bead621fc
@ -207,22 +207,18 @@ class NetworkSettingsViewController: UITableViewController {
|
||||
}
|
||||
|
||||
private func commitChanges() {
|
||||
let settings = profile?.manualNetworkSettings ?? ProfileNetworkSettings()
|
||||
profile?.networkChoices = networkChoices
|
||||
if networkChoices.gateway == .manual {
|
||||
let settings = profile?.manualNetworkSettings ?? ProfileNetworkSettings()
|
||||
settings.copyGateway(from: networkSettings)
|
||||
profile?.manualNetworkSettings = settings
|
||||
}
|
||||
if networkChoices.dns == .manual {
|
||||
let settings = profile?.manualNetworkSettings ?? ProfileNetworkSettings()
|
||||
settings.copyDNS(from: networkSettings)
|
||||
profile?.manualNetworkSettings = settings
|
||||
}
|
||||
if networkChoices.proxy == .manual {
|
||||
let settings = profile?.manualNetworkSettings ?? ProfileNetworkSettings()
|
||||
settings.copyProxy(from: networkSettings)
|
||||
profile?.manualNetworkSettings = settings
|
||||
}
|
||||
profile?.manualNetworkSettings = settings
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user