mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 20:09:04 +00:00
Remove now unneeded waitForInitialItems TimelineProvider method.
This commit is contained in:
committed by
Stefan Ceriu
parent
5984001720
commit
e66bbab63c
@@ -66,17 +66,6 @@ class TimelineItemProvider: TimelineItemProviderProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
/// A continuation to signal whether the initial timeline items have been loaded and processed.
|
||||
private var hasLoadedInitialItemsContinuation: CheckedContinuation<Void, Never>?
|
||||
/// A method that allows `await`ing the first update of timeline items from the listener, as the items
|
||||
/// aren't added directly to the provider upon initialisation and may take some time to come in.
|
||||
func waitForInitialItems() async {
|
||||
guard itemProxies.isEmpty else { return }
|
||||
return await withCheckedContinuation { continuation in
|
||||
hasLoadedInitialItemsContinuation = continuation
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func updateItemsWithDiffs(_ diffs: [TimelineDiff]) {
|
||||
@@ -101,11 +90,6 @@ class TimelineItemProvider: TimelineItemProviderProtocol {
|
||||
|
||||
return updatedItems
|
||||
}
|
||||
|
||||
if let hasLoadedInitialItemsContinuation {
|
||||
hasLoadedInitialItemsContinuation.resume()
|
||||
self.hasLoadedInitialItemsContinuation = nil
|
||||
}
|
||||
}
|
||||
|
||||
private func buildDiff(from diff: TimelineDiff, on itemProxies: [TimelineItemProxy]) -> CollectionDifference<TimelineItemProxy>? {
|
||||
|
||||
Reference in New Issue
Block a user