mirror of
https://github.com/lil-org/wallet.git
synced 2025-01-06 04:13:11 +03:00
Accounts list responds to becoming active
This commit is contained in:
parent
a9dee1df3c
commit
d820a07c79
@ -35,9 +35,21 @@ class AccountsListViewController: NSViewController {
|
||||
accounts = AccountsService.getAccounts()
|
||||
}
|
||||
|
||||
if onSelectedAccount != nil {
|
||||
titleLabel.stringValue = "Select\nAccount"
|
||||
}
|
||||
reloadTitle()
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(didBecomeActive), name: NSApplication.didBecomeActiveNotification, object: nil)
|
||||
}
|
||||
|
||||
deinit {
|
||||
NotificationCenter.default.removeObserver(self)
|
||||
}
|
||||
|
||||
private func reloadTitle() {
|
||||
titleLabel.stringValue = onSelectedAccount != nil ? "Select\nAccount" : "Accounts"
|
||||
}
|
||||
|
||||
@objc private func didBecomeActive() {
|
||||
// TODO: check if there is something good in pasteboard
|
||||
reloadTitle()
|
||||
}
|
||||
|
||||
@IBAction func addButtonTapped(_ sender: NSButton) {
|
||||
|
Loading…
Reference in New Issue
Block a user