From 94cb694a0dcf47af66a742bdb76cd68a57e3c5a4 Mon Sep 17 00:00:00 2001 From: ganfra Date: Thu, 13 Jul 2023 11:23:04 +0200 Subject: [PATCH] Timeline: revert back the paginateBackwards in the TimelinePresenter so it's now blocked in the Timeline if needed --- .../features/messages/impl/timeline/TimelinePresenter.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelinePresenter.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelinePresenter.kt index 913a878b12..0833ff2205 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelinePresenter.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelinePresenter.kt @@ -85,6 +85,11 @@ class TimelinePresenter @Inject constructor( timeline .timelineItems .onEach(timelineItemsFactory::replaceWith) + .onEach { timelineItems -> + if (timelineItems.isEmpty()) { + paginateBackwards() + } + } .launchIn(this) }