aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-12-21 18:02:18 +0530
committerRoopesh Chander <roop@roopc.net>2018-12-21 18:02:18 +0530
commite47a8232d89608e98a474317fa5266295c5808cd (patch)
treec21c0e6bd361881ec955133b3022406375ca680b /WireGuard/WireGuard/UI
parentNE: Update listen port only when first interface changes (diff)
downloadwireguard-apple-e47a8232d89608e98a474317fa5266295c5808cd.tar.xz
wireguard-apple-e47a8232d89608e98a474317fa5266295c5808cd.zip
Tunnel detail: iPad: Handle deletion of tunnel correctly
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI')
-rw-r--r--WireGuard/WireGuard/UI/iOS/ViewController/TunnelDetailTableViewController.swift13
1 files changed, 10 insertions, 3 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/ViewController/TunnelDetailTableViewController.swift b/WireGuard/WireGuard/UI/iOS/ViewController/TunnelDetailTableViewController.swift
index 6fb54fc..d3f9c84 100644
--- a/WireGuard/WireGuard/UI/iOS/ViewController/TunnelDetailTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/ViewController/TunnelDetailTableViewController.swift
@@ -243,14 +243,21 @@ extension TunnelDetailTableViewController {
cell.onTapped = { [weak self] in
guard let self = self else { return }
self.showConfirmationAlert(message: "Delete this tunnel?", buttonTitle: "Delete", from: cell) { [weak self] in
- guard let tunnelsManager = self?.tunnelsManager, let tunnel = self?.tunnel else { return }
- tunnelsManager.remove(tunnel: tunnel) { error in
+ guard let self = self else { return }
+ self.tunnelsManager.remove(tunnel: self.tunnel) { error in
if error != nil {
print("Error removing tunnel: \(String(describing: error))")
return
}
}
- self?.navigationController?.navigationController?.popToRootViewController(animated: true)
+ if self.splitViewController?.isCollapsed ?? true {
+ self.navigationController?.navigationController?.popToRootViewController(animated: true)
+ } else {
+ let detailVC = UIViewController()
+ detailVC.view.backgroundColor = .white
+ let detailNC = UINavigationController(rootViewController: detailVC)
+ self.showDetailViewController(detailNC, sender: self)
+ }
}
}
return cell