Skip to content

Commit

Permalink
[PBE-2806] Thread replies are scrolled to bottom on any event
Browse files Browse the repository at this point in the history
  • Loading branch information
kanat authored and JcMinarro committed May 16, 2024
1 parent 958a8f9 commit e417e33
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
Expand Down Expand Up @@ -265,10 +264,6 @@ internal fun BoxScope.DefaultMessagesHelperContent(

val offset = messagesLazyListState.focusedMessageOffset

val hasLoadedThread by derivedStateOf {
messagesState.messageItems.size > 1 && messagesState.parentMessageId != null
}

LaunchedEffect(newMessageState, focusedItemIndex, offset) {
if (focusedItemIndex != -1 &&
!lazyListState.isScrollInProgress
Expand All @@ -284,7 +279,7 @@ internal fun BoxScope.DefaultMessagesHelperContent(
newMessageState,
areNewestMessagesLoaded,
lazyListState.isScrollInProgress,
) || hasLoadedThread
)

if (shouldScrollToBottom) {
coroutineScope.launch {
Expand Down

0 comments on commit e417e33

Please sign in to comment.