From a8951089c305876ebf1fb9b9c62c44314986f872 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sat, 11 Jan 2020 12:51:13 -0700 Subject: [PATCH] Change to work with only article id's. Issue #1595 --- Shared/UserNotifications/UserNotificationManager.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Shared/UserNotifications/UserNotificationManager.swift b/Shared/UserNotifications/UserNotificationManager.swift index 04505b66f..2f37a2438 100644 --- a/Shared/UserNotifications/UserNotificationManager.swift +++ b/Shared/UserNotifications/UserNotificationManager.swift @@ -32,10 +32,10 @@ final class UserNotificationManager: NSObject { } @objc func statusesDidChange(_ note: Notification) { - guard let articles = note.userInfo?[Account.UserInfoKey.articles] as? Set
else { + guard let articleIDs = note.userInfo?[Account.UserInfoKey.articleIDs] as? Set, !articleIDs.isEmpty else { return } - let identifiers = articles.filter({ $0.status.read }).map { "articleID:\($0.articleID)" } + let identifiers = articleIDs.map { "articleID:\($0)" } UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: identifiers) }