diff --git a/Stats/Views/Dashboard.swift b/Stats/Views/Dashboard.swift index 853c7ac8..9c831fae 100644 --- a/Stats/Views/Dashboard.swift +++ b/Stats/Views/Dashboard.swift @@ -31,12 +31,18 @@ class Dashboard: NSStackView { scrollView.stackView.addArrangedSubview(self.specs()) self.addArrangedSubview(scrollView) + + NotificationCenter.default.addObserver(self, selector: #selector(windowOpens), name: .openModuleSettings, object: nil) } required public init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } + deinit { + NotificationCenter.default.removeObserver(self, name: .openModuleSettings, object: nil) + } + private func versions() -> NSView { let container: NSGridView = NSGridView() container.rowSpacing = 0 @@ -116,6 +122,7 @@ class Dashboard: NSStackView { } @objc private func windowOpens(_ notification: Notification) { + print(1) guard notification.userInfo?["module"] as? String == "Dashboard" else { return }