aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-05-27 15:36:34 +0530
committerRoopesh Chander <roop@roopc.net>2019-05-27 15:36:39 +0530
commitc5d4e716f3320fe5514db0c6126ef8330ad6c1b4 (patch)
tree40051a6a44c5d6f0fce9f5a86df6691fbad6773e
parentmacOS: Tunnel detail: No need to update runtime info on tunnelSaved() (diff)
downloadwireguard-apple-c5d4e716f3320fe5514db0c6126ef8330ad6c1b4.tar.xz
wireguard-apple-c5d4e716f3320fe5514db0c6126ef8330ad6c1b4.zip
iOS: Should be able to re-show tunnel detail
Fixes a bug introduced in the refactoring in commit 7322fb084087774e8b58e347902f6d7036cbde5c
-rw-r--r--WireGuard/WireGuard/UI/iOS/ViewController/TunnelsListTableViewController.swift20
1 files changed, 9 insertions, 11 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/ViewController/TunnelsListTableViewController.swift b/WireGuard/WireGuard/UI/iOS/ViewController/TunnelsListTableViewController.swift
index 43f58df7..372a8e39 100644
--- a/WireGuard/WireGuard/UI/iOS/ViewController/TunnelsListTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/ViewController/TunnelsListTableViewController.swift
@@ -257,18 +257,16 @@ class TunnelsListTableViewController: UIViewController {
guard let splitViewController = splitViewController else { return }
guard let navController = navigationController else { return }
- if detailDisplayedTunnel != tunnel {
- let tunnelDetailVC = TunnelDetailTableViewController(tunnelsManager: tunnelsManager,
- tunnel: tunnel)
- let tunnelDetailNC = UINavigationController(rootViewController: tunnelDetailVC)
- tunnelDetailNC.restorationIdentifier = "DetailNC"
- if splitViewController.isCollapsed && navController.viewControllers.count > 1 {
- navController.setViewControllers([self, tunnelDetailNC], animated: animated)
- } else {
- splitViewController.showDetailViewController(tunnelDetailNC, sender: self, animated: animated)
- }
- detailDisplayedTunnel = tunnel
+ let tunnelDetailVC = TunnelDetailTableViewController(tunnelsManager: tunnelsManager,
+ tunnel: tunnel)
+ let tunnelDetailNC = UINavigationController(rootViewController: tunnelDetailVC)
+ tunnelDetailNC.restorationIdentifier = "DetailNC"
+ if splitViewController.isCollapsed && navController.viewControllers.count > 1 {
+ navController.setViewControllers([self, tunnelDetailNC], animated: animated)
+ } else {
+ splitViewController.showDetailViewController(tunnelDetailNC, sender: self, animated: animated)
}
+ detailDisplayedTunnel = tunnel
self.presentedViewController?.dismiss(animated: false, completion: nil)
}
}