mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Fix a crash that can occur when updating timeline items in a background thread (#2268)
This commit is contained in:
@@ -238,7 +238,9 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
|
||||
|
||||
@objc private func contentSizeCategoryDidChange() {
|
||||
// Recompute all attributed strings on content size changes -> DynamicType support
|
||||
updateTimelineItems()
|
||||
serialDispatchQueue.async {
|
||||
self.updateTimelineItems()
|
||||
}
|
||||
}
|
||||
|
||||
private func updateTimelineItems() {
|
||||
@@ -303,7 +305,9 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
timelineItems = newTimelineItems
|
||||
DispatchQueue.main.sync {
|
||||
timelineItems = newTimelineItems
|
||||
}
|
||||
|
||||
callbacks.send(.updatedTimelineItems)
|
||||
callbacks.send(.canBackPaginate(canBackPaginate))
|
||||
|
||||
Reference in New Issue
Block a user