diff --git a/iOS/MainFeed/MainFeedCollectionViewController.swift b/iOS/MainFeed/MainFeedCollectionViewController.swift index 81a7ae3ae..df6e704d1 100644 --- a/iOS/MainFeed/MainFeedCollectionViewController.swift +++ b/iOS/MainFeed/MainFeedCollectionViewController.swift @@ -57,7 +57,7 @@ final class MainFeedCollectionViewController: UICollectionViewController, Undoab /// `viewDidAppear(_:)` after a delay to allow the deselection animation to complete. private var isAnimating: Bool = false - private var dataSource: UICollectionViewDiffableDataSource! + var dataSource: UICollectionViewDiffableDataSource! override func viewDidLoad() { super.viewDidLoad() diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index d4c4fe322..c38fd395f 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -35,8 +35,12 @@ struct FeedNode: Hashable, Sendable { self.sidebarItemID = (node.representedObject as! SidebarItem).sidebarItemID! } - func hash(into hasher: inout Hasher) { - hasher.combine(node) + nonisolated func hash(into hasher: inout Hasher) { + hasher.combine(ObjectIdentifier(node)) + } + + nonisolated static func == (lhs: FeedNode, rhs: FeedNode) -> Bool { + lhs.node === rhs.node } } @@ -749,9 +753,7 @@ struct FeedNode: Hashable, Sendable { } func indexPathFor(_ node: Node) -> IndexPath? { - let snapshot = mainFeedCollectionViewController.dataSource.snapshot() let feedNode = FeedNode(node) - return mainFeedCollectionViewController.dataSource.indexPath(for: feedNode) } @@ -1584,11 +1586,10 @@ private extension SceneCoordinator { } func addShadowTableToFilterExceptions() { - for section in shadowTable { - for feedNode in section.feedNodes { - if let feed = feedNode.node.representedObject as? SidebarItem, let sidebarItemID = feed.sidebarItemID { - treeControllerDelegate.addFilterException(sidebarItemID) - } + let snapshot = mainFeedCollectionViewController.dataSource.snapshot() + for feedNode in snapshot.itemIdentifiers { + if let feed = feedNode.node.representedObject as? SidebarItem, let sidebarItemID = feed.sidebarItemID { + treeControllerDelegate.addFilterException(sidebarItemID) } } }