From c65b69cfbd3f1275ee43299b8e77fc1641226abb Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 8 Mar 2022 12:00:08 -0500 Subject: [PATCH] Update home unread counts after sync --- Reader/Screens/Home/HomeViewController.swift | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Reader/Screens/Home/HomeViewController.swift b/Reader/Screens/Home/HomeViewController.swift index 298ec8f..3680aba 100644 --- a/Reader/Screens/Home/HomeViewController.swift +++ b/Reader/Screens/Home/HomeViewController.swift @@ -149,8 +149,16 @@ class HomeViewController: UIViewController { } private func syncStateChanged(_ newState: FervorController.SyncState) { - if newState == .done && syncStateView == nil { - return + if newState == .done { + // update unread counts for visible items + var snapshot = dataSource.snapshot() + snapshot.reconfigureItems(snapshot.itemIdentifiers) + dataSource.apply(snapshot, animatingDifferences: false) + + if syncStateView == nil { + // no sync state view, nothing further to update + return + } } func updateView(_ syncStateView: SyncStateView) {