mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-11 09:14:06 +01:00
Fix bug that was removing unread notifications by checking the status. Fixes #2786
This commit is contained in:
parent
69ce88af06
commit
cf73fb5bd3
@ -33,10 +33,10 @@ final class UserNotificationManager: NSObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@objc func statusesDidChange(_ note: Notification) {
|
@objc func statusesDidChange(_ note: Notification) {
|
||||||
guard let articleIDs = note.userInfo?[Account.UserInfoKey.articleIDs] as? Set<String>, !articleIDs.isEmpty else {
|
guard let statuses = note.userInfo?[Account.UserInfoKey.statuses] as? Set<ArticleStatus>, !statuses.isEmpty else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let identifiers = articleIDs.map { "articleID:\($0)" }
|
let identifiers = statuses.filter({ $0.read }).map { "articleID:\($0.articleID)" }
|
||||||
UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: identifiers)
|
UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: identifiers)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user