Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PBE-2806] Thread replies are scrolled to bottom on any event #5261

Merged
merged 1 commit into from
May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
JcMinarro marked this conversation as resolved.
Show resolved Hide resolved

LaunchedEffect(newMessageState, focusedItemIndex, offset) {
if (focusedItemIndex != -1 &&
!lazyListState.isScrollInProgress
Expand All @@ -284,7 +279,7 @@ internal fun BoxScope.DefaultMessagesHelperContent(
newMessageState,
areNewestMessagesLoaded,
lazyListState.isScrollInProgress,
) || hasLoadedThread
)
JcMinarro marked this conversation as resolved.
Show resolved Hide resolved

if (shouldScrollToBottom) {
coroutineScope.launch {
Expand Down
Loading