Skip to content

Commit

Permalink
Merge branch 'develop' into crash_when_recording_audio
Browse files Browse the repository at this point in the history
  • Loading branch information
ohassine authored Mar 1, 2024
2 parents 42cfbb6 + 84d3737 commit 998bae0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -895,14 +895,14 @@ fun MessageList(
) {
val prevItemCount = remember { mutableStateOf(lazyPagingMessages.itemCount) }
LaunchedEffect(lazyPagingMessages.itemCount) {
if (lazyPagingMessages.itemCount > prevItemCount.value) {
prevItemCount.value = lazyPagingMessages.itemCount

if (lazyListState.firstVisibleItemIndex > 0
if (lazyPagingMessages.itemCount > prevItemCount.value && selectedMessageId == null) {
if (prevItemCount.value > 0
&& lazyListState.firstVisibleItemIndex > 0
&& lazyListState.firstVisibleItemIndex <= MAXIMUM_SCROLLED_MESSAGES_UNTIL_AUTOSCROLL_STOPS
) {
lazyListState.animateScrollToItem(0)
}
prevItemCount.value = lazyPagingMessages.itemCount
}
}

Expand Down

0 comments on commit 998bae0

Please sign in to comment.