diff --git a/Tusker/Screens/Utilities/TimelineLikeCollectionViewController.swift b/Tusker/Screens/Utilities/TimelineLikeCollectionViewController.swift index 697e6b35..8239f09a 100644 --- a/Tusker/Screens/Utilities/TimelineLikeCollectionViewController.swift +++ b/Tusker/Screens/Utilities/TimelineLikeCollectionViewController.swift @@ -211,9 +211,10 @@ extension TimelineLikeCollectionViewController { extension TimelineLikeCollectionViewController { // apply(_:animatingDifferences:) is marked as nonisolated, so just awaiting it doesn't dispatch to the main thread, unlike other async @MainActor methods // but we always want to update the data source on the main thread for consistency, so this method does that - @MainActor func apply(_ snapshot: NSDiffableDataSourceSnapshot, animatingDifferences: Bool) async { - await self.dataSource.apply(snapshot, animatingDifferences: animatingDifferences) + await MainActor.run { + dataSource?.apply(snapshot, animatingDifferences: animatingDifferences) + } } @MainActor