forked from shadowfacts/Tusker
Fix TimelineLikeCollectionViewController.apply not actually applying snapshots on the main thread
This commit is contained in:
parent
4c5da1b5a9
commit
e6f1968609
|
@ -211,9 +211,10 @@ extension TimelineLikeCollectionViewController {
|
||||||
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
|
// 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
|
// 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 {
|
func apply(_ snapshot: NSDiffableDataSourceSnapshot<Section, Item>, animatingDifferences: Bool) async {
|
||||||
await self.dataSource.apply(snapshot, animatingDifferences: animatingDifferences)
|
await MainActor.run {
|
||||||
|
dataSource?.apply(snapshot, animatingDifferences: animatingDifferences)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
|
|
Loading…
Reference in New Issue