Merge pull request #5480 from cartesian-plane/fix/hang-contextual-menu-5450

Move article fetch after “Mark All as Read” action
This commit is contained in:
Brent Simmons authored and GitHub committed 2026-11-22 21:00:11 -08:00
commit cea2aeccf0
1 file changed
+3 -4
@@ -1518,9 +1518,7 @@ extension MainTimelineViewController {
return nil
}
let fetchedArticles = feed.fetchArticles()
let articles = Array(fetchedArticles)
guard articles.canMarkAllAsRead(), let collectionView, let contentView = collectionView.cellForItem(at: indexPath)?.contentView else {
guard feed.unreadCount > 0, let collectionView, let contentView = collectionView.cellForItem(at: indexPath)?.contentView else {
return nil
}
@@ -1529,7 +1527,8 @@ extension MainTimelineViewController {
let action = UIAction(title: title, image: Assets.Images.markAllAsRead) { [weak self] _ in
MarkAsReadAlertController.confirm(self, confirmTitle: title, sourceType: contentView) { [weak self] in
self?.markAllAsRead(articles)
let articles = feed.fetchUnreadArticles()
self?.markAllAsRead(Array(articles))
}
}
return action