From d15b227c33aede09e618a88c27db34a70aecbda2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Mart=C3=ADn?= Date: Wed, 12 Mar 2025 16:48:43 +0100 Subject: [PATCH] Fix lint issues --- .../android/features/messages/impl/timeline/TimelineView.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelineView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelineView.kt index d11d655ec5..bcf6365d6b 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelineView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelineView.kt @@ -177,9 +177,11 @@ fun TimelineView( onClearFocusRequestState = ::clearFocusRequestState ) - val isCloseToStartOfLoadedTimeline by remember { derivedStateOf { + val isCloseToStartOfLoadedTimeline by remember { + derivedStateOf { lazyListState.firstVisibleItemIndex + lazyListState.layoutInfo.visibleItemsInfo.size >= lazyListState.layoutInfo.totalItemsCount - 10 - } } + } + } LaunchedEffect(isCloseToStartOfLoadedTimeline) { // Only back paginate when we're close to the start of the loaded timeline items and the user is actively scrolling if (lazyListState.isScrollInProgress && isCloseToStartOfLoadedTimeline) {