]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
UI: iOS: Show on-demand state in 'Status' if there are on-demand rules
authorRoopesh Chander <roop@roopc.net>
Tue, 27 Jul 2021 21:00:24 +0000 (02:30 +0530)
committerRoopesh Chander <roop@roopc.net>
Tue, 27 Jul 2021 22:05:05 +0000 (03:35 +0530)
Signed-off-by: Roopesh Chander <roop@roopc.net>
Sources/WireGuardApp/Base.lproj/Localizable.strings
Sources/WireGuardApp/UI/iOS/ViewController/TunnelDetailTableViewController.swift

index 87935d1370e9e7df0ea39f4a1dd2841d964e1535..0e24ed3c081af28a219e308fe33d23e46fac6e48 100644 (file)
@@ -57,6 +57,7 @@
 "tunnelStatusWaiting" = "Waiting";
 
 "tunnelStatusAddendumOnDemand" = " (On Demand)";
+"tunnelStatusOnDemandDisabled" = "On Demand Disabled";
 
 "macToggleStatusButtonActivate" = "Activate";
 "macToggleStatusButtonActivating" = "Activating…";
index 675adfdf2b3280cdfa66142f59e15825f03e06a1..196de0c69064e0c4eaeec548ea680ee4b4c04eea 100644 (file)
@@ -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
         }