mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-28 16:26:04 +00:00
Use dataSource as source of truth for UI.
This commit is contained in:
1 parent
3e49a9ea15
commit
20b2c2e839
1 file changed
+6
-2
@@ -483,14 +483,18 @@ final class MainFeedCollectionViewController: UICollectionViewController, Undoab
|
||||
}
|
||||
|
||||
func configureIcon(_ cell: MainFeedCollectionViewCell, _ indexPath: IndexPath) {
|
||||
guard let node = coordinator.nodeFor(indexPath), let sidebarItem = node.representedObject as? SidebarItem, let sidebarItemID = sidebarItem.sidebarItemID else {
|
||||
guard let sidebarItemNode = dataSource.itemIdentifier(for: indexPath),
|
||||
let sidebarItem = sidebarItemNode.node.representedObject as? SidebarItem,
|
||||
let sidebarItemID = sidebarItem.sidebarItemID else {
|
||||
return
|
||||
}
|
||||
cell.iconImage = IconImageCache.shared.imageFor(sidebarItemID)
|
||||
}
|
||||
|
||||
func configureIcon(_ cell: MainFeedCollectionViewFolderCell, _ indexPath: IndexPath) {
|
||||
guard let node = coordinator.nodeFor(indexPath), let sidebarItem = node.representedObject as? SidebarItem, let sidebarItemID = sidebarItem.sidebarItemID else {
|
||||
guard let sidebarItemNode = dataSource.itemIdentifier(for: indexPath),
|
||||
let sidebarItem = sidebarItemNode.node.representedObject as? SidebarItem,
|
||||
let sidebarItemID = sidebarItem.sidebarItemID else {
|
||||
return
|
||||
}
|
||||
cell.iconImage = IconImageCache.shared.imageFor(sidebarItemID)
|
||||
|
||||
Reference in new issue
Block a user