mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-30 01:10:38 +00:00
Set only the image on the cell so each download doesn’t rebuild the whole cell.
This commit is contained in:
1 parent
210474f6ac
commit
f41d3d2ac7
5 files changed
+27
-11
No files matched your search
@@ -609,10 +609,10 @@ extension MainTimelineViewController: UICollectionViewDelegate {
|
||||
reloadCells([article])
|
||||
return
|
||||
}
|
||||
guard let thumbnailURL, let thumbnail = ArticleThumbnailFinder.shared.thumbnail(url: thumbnailURL, mode: thumbnailMode, articleTitle: article.title), thumbnail !== cellData.thumbnail else {
|
||||
guard let thumbnailURL, let thumbnail = ArticleThumbnailFinder.shared.thumbnail(url: thumbnailURL, mode: thumbnailMode, articleTitle: article.title), thumbnail !== cell.thumbnail else {
|
||||
return
|
||||
}
|
||||
cell.cellData = configure(article: article)
|
||||
cell.thumbnail = thumbnail
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, contextMenuConfigurationForItemsAt indexPaths: [IndexPath], point: CGPoint) -> UIContextMenuConfiguration? {
|
||||
@@ -1249,10 +1249,10 @@ private extension MainTimelineViewController {
|
||||
}
|
||||
// The row’s height already allows for the thumbnail, so only the cell’s contents change.
|
||||
for indexPath in collectionView.indexPathsForVisibleItems {
|
||||
guard let article = dataSource.itemIdentifier(for: indexPath), ArticleThumbnailFinder.shared.thumbnailURL(for: article, mode: thumbnailMode) == url, let cell = collectionView.cellForItem(at: indexPath) as? MainTimelineCell else {
|
||||
guard let article = dataSource.itemIdentifier(for: indexPath), ArticleThumbnailFinder.shared.thumbnailURL(for: article, mode: thumbnailMode) == url, let cell = collectionView.cellForItem(at: indexPath) as? MainTimelineCell, let thumbnail = ArticleThumbnailFinder.shared.thumbnail(url: url, mode: thumbnailMode, articleTitle: article.title) else {
|
||||
continue
|
||||
}
|
||||
cell.cellData = configure(article: article)
|
||||
cell.thumbnail = thumbnail
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user