Skip to content

Commit

Permalink
fix: message flickering [WPB-3983] (#2217)
Browse files Browse the repository at this point in the history
  • Loading branch information
Garzas authored and github-actions[bot] committed Sep 12, 2023
1 parent 07cab37 commit e93dfa0
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -757,12 +757,22 @@ fun MessageList(
// We can draw a placeholder here, as we fetch the next page of messages
return@itemsIndexed
}
val showAuthor by remember {
mutableStateOf(
AuthorHeaderHelper.shouldShowHeader(
index,
lazyPagingMessages.itemSnapshotList.items,
message
)
)
}

when (message) {
is UIMessage.Regular -> {
MessageItem(
message = message,
conversationDetailsData = conversationDetailsData,
showAuthor = AuthorHeaderHelper.shouldShowHeader(index, lazyPagingMessages.itemSnapshotList.items, message),
showAuthor = showAuthor,
audioMessagesState = audioMessagesState,
onAudioClick = onAudioItemClicked,
onChangeAudioPosition = onChangeAudioPosition,
Expand Down

0 comments on commit e93dfa0

Please sign in to comment.