Update unread counts for activate/inactivate and delete account
This commit is contained in:
parent
c25680ca5d
commit
e0efcfa847
|
@ -90,7 +90,8 @@ public final class AccountManager: UnreadCountProvider {
|
|||
readAccountsFromDisk()
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(unreadCountDidChange(_:)), name: .UnreadCountDidChange, object: nil)
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(accountStateDidChange(_:)), name: .AccountStateDidChange, object: nil)
|
||||
|
||||
DispatchQueue.main.async {
|
||||
self.updateUnreadCount()
|
||||
}
|
||||
|
@ -134,6 +135,7 @@ public final class AccountManager: UnreadCountProvider {
|
|||
abort()
|
||||
}
|
||||
|
||||
updateUnreadCount()
|
||||
NotificationCenter.default.post(name: .AccountsDidChangeNotification, object: self)
|
||||
|
||||
}
|
||||
|
@ -184,6 +186,10 @@ public final class AccountManager: UnreadCountProvider {
|
|||
updateUnreadCount()
|
||||
}
|
||||
|
||||
@objc func accountStateDidChange(_ notification: Notification) {
|
||||
updateUnreadCount()
|
||||
}
|
||||
|
||||
// MARK: Private
|
||||
|
||||
private func loadAccount(_ accountSpecifier: AccountSpecifier) -> Account? {
|
||||
|
|
Loading…
Reference in New Issue