mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-30 17:29:23 +00:00
Reload iOS timeline cells for icon change only when a visible cell might show that icon.
This commit is contained in:
1 parent
feda636b0c
commit
e166dbdd9c
1 file changed
+10
-10
@@ -398,6 +398,14 @@ final class MainTimelineViewController: UIViewController, UndoableCommandRunner
|
||||
updateQueue.add(self, #selector(reloadVisibleCells))
|
||||
}
|
||||
|
||||
/// Icons arrive in bursts, so the reload is still coalesced.
|
||||
private func queueReloadIfVisibleArticleMightShowIcon(in notification: Notification) {
|
||||
guard isViewLoaded, showIcons, visibleArticles().contains(where: { $0.mightShowIcon(in: notification) }) else {
|
||||
return
|
||||
}
|
||||
queueReloadAvailableCells()
|
||||
}
|
||||
|
||||
@objc private func reloadVisibleCells() {
|
||||
Self.logger.debug("MainTimelineViewController: reloadVisibleCells")
|
||||
guard isViewLoaded, let collectionView, let dataSource else {
|
||||
@@ -1133,20 +1141,12 @@ private extension MainTimelineViewController {
|
||||
|
||||
@objc func handleFeedIconImageDidChange(_ notification: Notification) {
|
||||
Self.logger.debug("MainTimelineViewController: handleFeedIconImageDidChange")
|
||||
|
||||
guard isViewLoaded else {
|
||||
return
|
||||
}
|
||||
queueReloadAvailableCells()
|
||||
queueReloadIfVisibleArticleMightShowIcon(in: notification)
|
||||
}
|
||||
|
||||
@objc func handleAuthorAvatarImageDidChange(_ notification: Notification) {
|
||||
Self.logger.debug("MainTimelineViewController: handleAuthorAvatarImageDidChange")
|
||||
|
||||
guard isViewLoaded else {
|
||||
return
|
||||
}
|
||||
queueReloadAvailableCells()
|
||||
queueReloadIfVisibleArticleMightShowIcon(in: notification)
|
||||
}
|
||||
|
||||
@objc func timelineIconSizeDidChange(_ note: Notification) {
|
||||
|
||||
Reference in new issue
Block a user