aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift
diff options
context:
space:
mode:
Diffstat (limited to 'WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift')
-rw-r--r--WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift21
1 files changed, 1 insertions, 20 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift
index 5873f1d..a888924 100644
--- a/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift
@@ -426,26 +426,7 @@ class TunnelDetailTableViewActivateOnDemandCell: UITableViewCell {
}
func update(from activateOnDemandSetting: ActivateOnDemandSetting?) {
- let detailText: String
- if let activateOnDemandSetting = activateOnDemandSetting {
- if (activateOnDemandSetting.isActivateOnDemandEnabled) {
- switch (activateOnDemandSetting.activateOnDemandOption) {
- case .none:
- detailText = "Off"
- case .useOnDemandOverWiFiOrCellular:
- detailText = "Wi-Fi or cellular"
- case .useOnDemandOverWiFiOnly:
- detailText = "Wi-Fi only"
- case .useOnDemandOverCellularOnly:
- detailText = "Cellular only"
- }
- } else {
- detailText = "Off"
- }
- } else {
- detailText = "Off"
- }
- detailTextLabel?.text = detailText
+ detailTextLabel?.text = TunnelViewModel.activateOnDemandDetailText(for: activateOnDemandSetting)
}
override func prepareForReuse() {