mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Use .appUnreadCountDidChange notification solely to get unread count.
This commit is contained in:
@@ -53,13 +53,14 @@ final class UnreadFeed: PseudoFeed {
|
||||
|
||||
@MainActor init() {
|
||||
|
||||
self.unreadCount = appDelegate.unreadCount
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(appUnreadCountDidChange(_:)), name: .appUnreadCountDidChange, object: nil)
|
||||
}
|
||||
|
||||
@objc @MainActor func appUnreadCountDidChange(_ note: Notification) {
|
||||
|
||||
unreadCount = appDelegate.unreadCount
|
||||
|
||||
if let unreadCount = note.unreadCount {
|
||||
self.unreadCount = unreadCount
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user