aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-05-26 20:04:02 +0530
committerRoopesh Chander <roop@roopc.net>2019-05-27 14:38:17 +0530
commit30da10a0e91f8614193619f7b40ee2441d14f44d (patch)
tree3fbd400d5f5f3b7d0bf44c5136bb46c38f4a3322 /WireGuard
parentmacOS: Fix residual menu highlight on reopen (diff)
downloadwireguard-apple-30da10a0e91f8614193619f7b40ee2441d14f44d.tar.xz
wireguard-apple-30da10a0e91f8614193619f7b40ee2441d14f44d.zip
macOS: Start refreshing runtime info in viewWillAppear(), not init()
Because when the window is closed and reopened, we should start refreshing runtime info again. Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard')
-rw-r--r--WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift7
1 files changed, 6 insertions, 1 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift
index 9cd9c76..5158b37 100644
--- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift
+++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift
@@ -101,7 +101,6 @@ class TunnelDetailTableViewController: NSViewController {
super.init(nibName: nil, bundle: nil)
updateTableViewModelRowsBySection()
updateTableViewModelRows()
- updateStatus()
statusObservationToken = tunnel.observe(\TunnelContainer.status) { [weak self] _, _ in
self?.updateStatus()
}
@@ -227,6 +226,12 @@ class TunnelDetailTableViewController: NSViewController {
}
}
+ override func viewWillAppear() {
+ if tunnel.status == .active {
+ startUpdatingRuntimeConfiguration()
+ }
+ }
+
override func viewWillDisappear() {
super.viewWillDisappear()
if let tunnelEditVC = tunnelEditVC {