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) {
|
||||
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
|
||||
}
|
||||
let identifiers = articleIDs.map { "articleID:\($0)" }
|
||||
let identifiers = statuses.filter({ $0.read }).map { "articleID:\($0.articleID)" }
|
||||
UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: identifiers)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue