From 34dc9cf2befe3bc8c8eb074775a37c50c048b2a7 Mon Sep 17 00:00:00 2001 From: Serhiy Mytrovtsiy Date: Fri, 6 Jun 2025 18:23:18 +0200 Subject: [PATCH] fix: added additional listener for Dashboard uptime to handle updates when open from the Combined view (#2569) --- Stats/Views/Dashboard.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Stats/Views/Dashboard.swift b/Stats/Views/Dashboard.swift index dc438b65..03fe09fe 100644 --- a/Stats/Views/Dashboard.swift +++ b/Stats/Views/Dashboard.swift @@ -193,6 +193,7 @@ class Dashboard: NSStackView { self.addArrangedSubview(scrollView) NotificationCenter.default.addObserver(self, selector: #selector(windowOpens), name: .openModuleSettings, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(windowOpens), name: .toggleSettings, object: nil) } required public init?(coder: NSCoder) { @@ -201,6 +202,7 @@ class Dashboard: NSStackView { deinit { NotificationCenter.default.removeObserver(self, name: .openModuleSettings, object: nil) + NotificationCenter.default.removeObserver(self, name: .toggleSettings, object: nil) } private func deviceView() -> NSView { @@ -238,7 +240,7 @@ class Dashboard: NSStackView { } @objc private func windowOpens(_ notification: Notification) { - guard notification.userInfo?["module"] as? String == "Dashboard" else { return } + guard let moduleName = notification.userInfo?["module"] as? String, moduleName == "Dashboard" || moduleName == "Combined modules" else { return } self.uptimeField?.stringValue = self.uptimeValue } }