MarkAllAsReadAction will check for and handle SmartFeeds.
This commit is contained in:
Stuart Breckenridge 2021-04-24 15:05:11 +08:00
parent f7762dcaaf
commit 15fb5637ff
No known key found for this signature in database
GPG Key ID: ED2F112EEA9EF8A5
1 changed files with 13 additions and 2 deletions

View File

@ -1211,9 +1211,20 @@ private extension MasterFeedViewController {
guard let identifier = dataSource.itemIdentifier(for: indexPath), identifier.unreadCount > 0 else { guard let identifier = dataSource.itemIdentifier(for: indexPath), identifier.unreadCount > 0 else {
return nil return nil
} }
var smartFeed: Feed?
if identifier.isPsuedoFeed {
if SmartFeedsController.shared.todayFeed.feedID == identifier.feedID {
smartFeed = SmartFeedsController.shared.todayFeed
} else if SmartFeedsController.shared.unreadFeed.feedID == identifier.feedID {
smartFeed = SmartFeedsController.shared.unreadFeed
} else if SmartFeedsController.shared.starredFeed.feedID == identifier.feedID {
smartFeed = SmartFeedsController.shared.starredFeed
}
}
guard let feedID = identifier.feedID, guard let feedID = identifier.feedID,
let feed = AccountManager.shared.existingFeed(with: feedID), let feed = smartFeed ?? AccountManager.shared.existingFeed(with: feedID),
feed.unreadCount > 0, feed.unreadCount > 0,
let contentView = self.tableView.cellForRow(at: indexPath)?.contentView else { let contentView = self.tableView.cellForRow(at: indexPath)?.contentView else {
return nil return nil