From 7ad0b6b604cdda6f9349fbc859763f472b7833cd Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Tue, 10 Sep 2019 20:28:16 -0700 Subject: [PATCH] Always update the unread count in the timeline after doing a sync fetch after representedObjects changes. Reload visible cells whenever showFeedNames changes. Fix #923. --- Mac/MainWindow/Timeline/TimelineViewController.swift | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Mac/MainWindow/Timeline/TimelineViewController.swift b/Mac/MainWindow/Timeline/TimelineViewController.swift index 14b953e7a..4b770b8e6 100644 --- a/Mac/MainWindow/Timeline/TimelineViewController.swift +++ b/Mac/MainWindow/Timeline/TimelineViewController.swift @@ -48,6 +48,7 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr if articles.count > 0 { tableView.scrollRowToVisible(0) } + updateUnreadCount() } } } @@ -106,6 +107,7 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr if showFeedNames != oldValue { updateShowAvatars() updateTableViewRowHeight() + reloadVisibleCells() } } } @@ -1009,10 +1011,7 @@ private extension TimelineViewController { } func replaceArticles(with unsortedArticles: Set
) { - let sortedArticles = Array(unsortedArticles).sortedByDate(sortDirection) - if articles != sortedArticles { - articles = sortedArticles - } + articles = Array(unsortedArticles).sortedByDate(sortDirection) } func fetchUnsortedArticlesSync(for representedObjects: [Any]) -> Set
{