diff options
author | Roopesh Chander <roop@roopc.net> | 2019-03-08 16:12:54 +0530 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-03-18 06:46:55 +0100 |
commit | 062b4d4b16bbe1b64a679a4fd77599380a9742d0 (patch) | |
tree | 1519c3d399dc914083ee091cbeab625089f06f69 /WireGuard/WireGuard/UI/iOS | |
parent | on-demand: TunnelViewModel: Remove unused on-demand-related methods (diff) | |
download | wireguard-apple-062b4d4b16bbe1b64a679a4fd77599380a9742d0.tar.xz wireguard-apple-062b4d4b16bbe1b64a679a4fd77599380a9742d0.zip |
on-demand: Remove ActivateOnDemandSetting type
The ActivateOnDemandOption type shall be used instead
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI/iOS')
-rw-r--r-- | WireGuard/WireGuard/UI/iOS/ViewController/TunnelDetailTableViewController.swift | 6 | ||||
-rw-r--r-- | WireGuard/WireGuard/UI/iOS/ViewController/TunnelEditTableViewController.swift | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/ViewController/TunnelDetailTableViewController.swift b/WireGuard/WireGuard/UI/iOS/ViewController/TunnelDetailTableViewController.swift index 19d66e7..4ed75a6 100644 --- a/WireGuard/WireGuard/UI/iOS/ViewController/TunnelDetailTableViewController.swift +++ b/WireGuard/WireGuard/UI/iOS/ViewController/TunnelDetailTableViewController.swift @@ -45,7 +45,7 @@ class TunnelDetailTableViewController: UITableViewController { self.tunnelsManager = tunnelsManager self.tunnel = tunnel tunnelViewModel = TunnelViewModel(tunnelConfiguration: tunnel.tunnelConfiguration) - onDemandViewModel = ActivateOnDemandViewModel(setting: tunnel.activateOnDemandSetting) + onDemandViewModel = ActivateOnDemandViewModel(option: tunnel.onDemandOption) super.init(style: .grouped) loadSections() loadVisibleFields() @@ -60,7 +60,7 @@ class TunnelDetailTableViewController: UITableViewController { } onDemandObservationToken = tunnel.observe(\.isActivateOnDemandEnabled) { [weak self] tunnel, _ in // Handle On-Demand getting turned on/off outside of the app - self?.onDemandViewModel = ActivateOnDemandViewModel(setting: tunnel.activateOnDemandSetting) + self?.onDemandViewModel = ActivateOnDemandViewModel(option: tunnel.onDemandOption) self?.updateActivateOnDemandFields() } } @@ -274,7 +274,7 @@ class TunnelDetailTableViewController: UITableViewController { extension TunnelDetailTableViewController: TunnelEditTableViewControllerDelegate { func tunnelSaved(tunnel: TunnelContainer) { tunnelViewModel = TunnelViewModel(tunnelConfiguration: tunnel.tunnelConfiguration) - onDemandViewModel = ActivateOnDemandViewModel(setting: tunnel.activateOnDemandSetting) + onDemandViewModel = ActivateOnDemandViewModel(option: tunnel.onDemandOption) loadSections() loadVisibleFields() title = tunnel.name diff --git a/WireGuard/WireGuard/UI/iOS/ViewController/TunnelEditTableViewController.swift b/WireGuard/WireGuard/UI/iOS/ViewController/TunnelEditTableViewController.swift index f640414..e5f322a 100644 --- a/WireGuard/WireGuard/UI/iOS/ViewController/TunnelEditTableViewController.swift +++ b/WireGuard/WireGuard/UI/iOS/ViewController/TunnelEditTableViewController.swift @@ -60,7 +60,7 @@ class TunnelEditTableViewController: UITableViewController { self.tunnelsManager = tunnelsManager self.tunnel = tunnel tunnelViewModel = TunnelViewModel(tunnelConfiguration: tunnel.tunnelConfiguration) - onDemandViewModel = ActivateOnDemandViewModel(setting: tunnel.activateOnDemandSetting) + onDemandViewModel = ActivateOnDemandViewModel(option: tunnel.onDemandOption) super.init(style: .grouped) loadSections() } @@ -113,10 +113,10 @@ class TunnelEditTableViewController: UITableViewController { ErrorPresenter.showErrorAlert(title: alertTitle, message: errorMessage, from: self) tableView.reloadData() // Highlight erroring fields case .saved(let tunnelConfiguration): - let activateOnDemandSetting = ActivateOnDemandSetting(with: onDemandViewModel.toOnDemandOption()) + let onDemandOption = onDemandViewModel.toOnDemandOption() if let tunnel = tunnel { // We're modifying an existing tunnel - tunnelsManager.modify(tunnel: tunnel, tunnelConfiguration: tunnelConfiguration, activateOnDemandSetting: activateOnDemandSetting) { [weak self] error in + tunnelsManager.modify(tunnel: tunnel, tunnelConfiguration: tunnelConfiguration, onDemandOption: onDemandOption) { [weak self] error in if let error = error { ErrorPresenter.showErrorAlert(error: error, from: self) } else { @@ -126,7 +126,7 @@ class TunnelEditTableViewController: UITableViewController { } } else { // We're adding a new tunnel - tunnelsManager.add(tunnelConfiguration: tunnelConfiguration, activateOnDemandSetting: activateOnDemandSetting) { [weak self] result in + tunnelsManager.add(tunnelConfiguration: tunnelConfiguration, onDemandOption: onDemandOption) { [weak self] result in if let error = result.error { ErrorPresenter.showErrorAlert(error: error, from: self) } else { |