diff --git a/Evergreen/MainWindow/Timeline/TimelineViewController.swift b/Evergreen/MainWindow/Timeline/TimelineViewController.swift index 9fad68058..993a8d8ba 100644 --- a/Evergreen/MainWindow/Timeline/TimelineViewController.swift +++ b/Evergreen/MainWindow/Timeline/TimelineViewController.swift @@ -679,11 +679,8 @@ private extension TimelineViewController { for object in representedObjects { - if let feed = object as? Feed { - fetchedArticles.formUnion(feed.fetchArticles()) - } - else if let folder = object as? Folder { - fetchedArticles.formUnion(folder.fetchArticles()) + if let articleFetcher = object as? ArticleFetcher { + fetchedArticles.formUnion(articleFetcher.fetchArticles()) } } diff --git a/Evergreen/SmartFeeds/UnreadFeed.swift b/Evergreen/SmartFeeds/UnreadFeed.swift index d80b0e07c..eae26a601 100644 --- a/Evergreen/SmartFeeds/UnreadFeed.swift +++ b/Evergreen/SmartFeeds/UnreadFeed.swift @@ -7,6 +7,8 @@ // import Foundation +import Account +import Data // This just shows the global unread count, which appDelegate already has. Easy. @@ -34,3 +36,20 @@ final class UnreadFeed: PseudoFeed { unreadCount = appDelegate.unreadCount } } + +extension UnreadFeed: ArticleFetcher { + + func fetchArticles() -> Set
{ + + return fetchUnreadArticles() + } + + func fetchUnreadArticles() -> Set
{ + + var articles = Set
() + for account in AccountManager.shared.accounts { + articles.formUnion(account.fetchUnreadArticles()) + } + return articles + } +}