diff --git a/Modules/Images/Sources/Images/FeedIconDownloader.swift b/Modules/Images/Sources/Images/FeedIconDownloader.swift index 8f603803f..8eabb5241 100644 --- a/Modules/Images/Sources/Images/FeedIconDownloader.swift +++ b/Modules/Images/Sources/Images/FeedIconDownloader.swift @@ -186,11 +186,6 @@ extension Notification.Name { _ = icon(for: feed) } } - - /// Returns the in-memory icon for `feed` without triggering a download. - public func cachedIcon(for feed: Feed) -> IconImage? { - cache[feed]?.iconImage - } } private extension FeedIconDownloader { diff --git a/Shared/IconImageCache.swift b/Shared/IconImageCache.swift index 448066864..e5667b807 100644 --- a/Shared/IconImageCache.swift +++ b/Shared/IconImageCache.swift @@ -138,7 +138,8 @@ private extension IconImageCache { // dictionaries so a newly arrived icon replaces a stale one. The dictionaries // keep the last known icons across the downloaders’ low-memory and background flushes. // - if let iconImage = FeedIconDownloader.shared.cachedIcon(for: feed) { + // A miss requests the feed icon, so it comes back after a flush without waiting for a prefetch. + if let iconImage = FeedIconDownloader.shared.icon(for: feed) { feedIconImageCache[feedID] = iconImage return iconImage } diff --git a/iOS/MainFeed/MainFeedCollectionViewController.swift b/iOS/MainFeed/MainFeedCollectionViewController.swift index 48e69d3f5..c7f99cd7c 100644 --- a/iOS/MainFeed/MainFeedCollectionViewController.swift +++ b/iOS/MainFeed/MainFeedCollectionViewController.swift @@ -885,7 +885,6 @@ final class MainFeedCollectionViewController: UICollectionViewController, Undoab // MARK: - Notifications @objc func preferredContentSizeCategoryDidChange() { - IconImageCache.shared.emptyCache() reloadAllVisibleCells() }