aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2021-07-28 02:30:24 +0530
committerRoopesh Chander <roop@roopc.net>2021-07-28 03:35:05 +0530
commit147ac02f0d065e3f68261f2ee7394874ae5d970f (patch)
tree75a219cc219e883537097c454a3edd432f472f18
parentUI: When reloading tunnels, preserve '.waiting' state (diff)
downloadwireguard-apple-147ac02f0d065e3f68261f2ee7394874ae5d970f.tar.xz
wireguard-apple-147ac02f0d065e3f68261f2ee7394874ae5d970f.zip
UI: iOS: Show on-demand state in 'Status' if there are on-demand rules
Signed-off-by: Roopesh Chander <roop@roopc.net>
-rw-r--r--Sources/WireGuardApp/Base.lproj/Localizable.strings1
-rw-r--r--Sources/WireGuardApp/UI/iOS/ViewController/TunnelDetailTableViewController.swift5
2 files changed, 6 insertions, 0 deletions
diff --git a/Sources/WireGuardApp/Base.lproj/Localizable.strings b/Sources/WireGuardApp/Base.lproj/Localizable.strings
index 87935d1..0e24ed3 100644
--- a/Sources/WireGuardApp/Base.lproj/Localizable.strings
+++ b/Sources/WireGuardApp/Base.lproj/Localizable.strings
@@ -57,6 +57,7 @@
"tunnelStatusWaiting" = "Waiting";
"tunnelStatusAddendumOnDemand" = " (On Demand)";
+"tunnelStatusOnDemandDisabled" = "On Demand Disabled";
"macToggleStatusButtonActivate" = "Activate";
"macToggleStatusButtonActivating" = "Activating…";
diff --git a/Sources/WireGuardApp/UI/iOS/ViewController/TunnelDetailTableViewController.swift b/Sources/WireGuardApp/UI/iOS/ViewController/TunnelDetailTableViewController.swift
index 675adfd..196de0c 100644
--- a/Sources/WireGuardApp/UI/iOS/ViewController/TunnelDetailTableViewController.swift
+++ b/Sources/WireGuardApp/UI/iOS/ViewController/TunnelDetailTableViewController.swift
@@ -365,6 +365,11 @@ extension TunnelDetailTableViewController {
cell.switchView.isUserInteractionEnabled = (status == .inactive || status == .active)
cell.isEnabled = (status == .inactive || status == .active)
}
+
+ if tunnel.hasOnDemandRules && !isOnDemandEngaged && status == .inactive {
+ text = tr("tunnelStatusOnDemandDisabled")
+ }
+
cell.textLabel?.text = text
}