Use .appUnreadCountDidChange notification solely to get unread count.

This commit is contained in:
Brent Simmons 2024-06-26 23:13:25 -07:00
parent 00f3b423f6
commit 45139866c3

View File

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