Clean up TimelineLikeCollectionViewController.apply(_:animatingDifferences:)
This commit is contained in:
parent
c4bf5d406d
commit
4af56e48bf
|
@ -211,11 +211,9 @@ 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<Section, Item>, animatingDifferences: Bool) async {
|
||||
let task = Task { @MainActor in
|
||||
self.dataSource.apply(snapshot, animatingDifferences: animatingDifferences)
|
||||
}
|
||||
await task.value
|
||||
await self.dataSource.apply(snapshot, animatingDifferences: animatingDifferences)
|
||||
}
|
||||
|
||||
@MainActor
|
||||
|
|
Loading…
Reference in New Issue