fix: added a listener for window open to the dashboard view (#1237)

This commit is contained in:
Serhiy Mytrovtsiy
2022-12-19 17:57:00 +01:00
parent d382491cb7
commit a26b450dd8

View File

@@ -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
}