UI: iOS: Show on-demand state in 'Status' if there are on-demand rules

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander 2021-07-28 02:30:24 +05:30
parent 03ef79c0fd
commit 147ac02f0d
2 changed files with 6 additions and 0 deletions

View File

@ -57,6 +57,7 @@
"tunnelStatusWaiting" = "Waiting";
"tunnelStatusAddendumOnDemand" = " (On Demand)";
"tunnelStatusOnDemandDisabled" = "On Demand Disabled";
"macToggleStatusButtonActivate" = "Activate";
"macToggleStatusButtonActivating" = "Activating…";

View 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
}