mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-28 16:26:04 +00:00
Request a feed icon when it isn’t in memory.
This commit is contained in:
1 parent
03aa00f151
commit
9b35e47f68
3 files changed
+2
-7
No files matched your search
@@ -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 {
|
||||
|
||||
@@ -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.
|
||||
// <https://github.com/Ranchero-Software/NetNewsWire/issues/5376>
|
||||
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
|
||||
}
|
||||
|
||||
@@ -885,7 +885,6 @@ final class MainFeedCollectionViewController: UICollectionViewController, Undoab
|
||||
// MARK: - Notifications
|
||||
|
||||
@objc func preferredContentSizeCategoryDidChange() {
|
||||
IconImageCache.shared.emptyCache()
|
||||
reloadAllVisibleCells()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user