aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/iOS/ViewController/TunnelEditTableViewController.swift
diff options
context:
space:
mode:
Diffstat (limited to 'WireGuard/WireGuard/UI/iOS/ViewController/TunnelEditTableViewController.swift')
-rw-r--r--WireGuard/WireGuard/UI/iOS/ViewController/TunnelEditTableViewController.swift13
1 files changed, 10 insertions, 3 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/ViewController/TunnelEditTableViewController.swift b/WireGuard/WireGuard/UI/iOS/ViewController/TunnelEditTableViewController.swift
index 6f0444e..f640414 100644
--- a/WireGuard/WireGuard/UI/iOS/ViewController/TunnelEditTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/ViewController/TunnelEditTableViewController.swift
@@ -442,6 +442,7 @@ extension TunnelEditTableViewController {
} else {
let cell: ChevronCell = tableView.dequeueReusableCell(for: indexPath)
cell.message = field.localizedUIString
+ cell.detailMessage = onDemandViewModel.ssidOption.localizedUIString
return cell
}
}
@@ -500,8 +501,14 @@ extension TunnelEditTableViewController {
extension TunnelEditTableViewController: SSIDOptionEditTableViewControllerDelegate {
func ssidOptionSaved(option: ActivateOnDemandViewModel.OnDemandSSIDOption, ssids: [String]) {
- let validSSIDs = ssids.filter { !$0.isEmpty }
- onDemandViewModel.selectedSSIDs = validSSIDs
- onDemandViewModel.ssidOption = validSSIDs.isEmpty ? .anySSID : option
+ onDemandViewModel.selectedSSIDs = ssids
+ onDemandViewModel.ssidOption = option
+ onDemandViewModel.fixSSIDOption()
+ if let onDemandSection = sections.firstIndex(where: { $0 == .onDemand }) {
+ if let ssidRowIndex = onDemandFields.firstIndex(of: .ssid) {
+ let indexPath = IndexPath(row: ssidRowIndex, section: onDemandSection)
+ tableView.reloadRows(at: [indexPath], with: .none)
+ }
+ }
}
}