Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanceriu committed Feb 5, 2025
1 parent 719fe4f commit 1f24bf0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class UserIndicatorController: ObservableObject, UserIndicatorControllerProtocol
}

Task {
try await Task.sleep(for: .seconds(minimumDisplayDuration))
try? await Task.sleep(for: .seconds(minimumDisplayDuration))
indicatorQueue.removeAll { $0.id == id }
displayTimes[id] = nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,12 +376,12 @@ class TimelineController: TimelineControllerProtocol {
callbacks.send(.isLive(activeTimelineProvider.kind == .live))

updateTimelineItemsCancellable = Task { [weak self, activeTimelineProvider] in
let publisher = activeTimelineProvider.updatePublisher
let notification = NotificationCenter.default.publisher(for: UIContentSizeCategory.didChangeNotification)
let contentSizeChangePublisher = NotificationCenter.default.publisher(for: UIContentSizeCategory.didChangeNotification)
let timelineUpdates = activeTimelineProvider.updatePublisher.merge(with: contentSizeChangePublisher.map { _ in
(activeTimelineProvider.itemProxies, activeTimelineProvider.paginationState)
})

let whatever = publisher.merge(with: notification.map { _ in (activeTimelineProvider.itemProxies, activeTimelineProvider.paginationState) })

for await (items, paginationState) in whatever.values {
for await (items, paginationState) in timelineUpdates.values {
await self?.updateTimelineItems(itemProxies: items, paginationState: paginationState)
}
}.asCancellable()
Expand Down

0 comments on commit 1f24bf0

Please sign in to comment.