aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift11
1 files changed, 10 insertions, 1 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift
index 70085d76..546d1c1f 100644
--- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift
+++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift
@@ -84,6 +84,7 @@ class TunnelDetailTableViewController: NSViewController {
}
private var tableViewModelRows = [TableViewModelRow]()
private var statusObservationToken: AnyObject?
+ private var tunnelEditVC: TunnelEditViewController?
init(tunnelsManager: TunnelsManager, tunnel: TunnelContainer) {
self.tunnelsManager = tunnelsManager
@@ -201,6 +202,7 @@ class TunnelDetailTableViewController: NSViewController {
let tunnelEditVC = TunnelEditViewController(tunnelsManager: tunnelsManager, tunnel: tunnel)
tunnelEditVC.delegate = self
presentAsSheet(tunnelEditVC)
+ self.tunnelEditVC = tunnelEditVC
}
@objc func handleToggleActiveStatusAction() {
@@ -219,6 +221,13 @@ class TunnelDetailTableViewController: NSViewController {
tunnelsManager.startDeactivation(of: tunnel)
}
}
+
+ override func viewWillDisappear() {
+ super.viewWillDisappear()
+ if let tunnelEditVC = tunnelEditVC {
+ dismiss(tunnelEditVC)
+ }
+ }
}
extension TunnelDetailTableViewController: NSTableViewDataSource {
@@ -264,6 +273,6 @@ extension TunnelDetailTableViewController: TunnelEditViewControllerDelegate {
}
func tunnelEditingCancelled() {
- // Nothing to do
+ self.tunnelEditVC = nil
}
}