Change to work with only article id's. Issue #1595

This commit is contained in:
Maurice Parker 2020-01-11 12:51:13 -07:00
parent 911d4ed248
commit a8951089c3

View File

@ -32,10 +32,10 @@ final class UserNotificationManager: NSObject {
} }
@objc func statusesDidChange(_ note: Notification) { @objc func statusesDidChange(_ note: Notification) {
guard let articles = note.userInfo?[Account.UserInfoKey.articles] as? Set<Article> else { guard let articleIDs = note.userInfo?[Account.UserInfoKey.articleIDs] as? Set<String>, !articleIDs.isEmpty else {
return return
} }
let identifiers = articles.filter({ $0.status.read }).map { "articleID:\($0.articleID)" } let identifiers = articleIDs.map { "articleID:\($0)" }
UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: identifiers) UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: identifiers)
} }