🚸 (bot) Don't auto scroll if a text bubble was streamed

Closes #702
This commit is contained in:
Baptiste Arnaud
2023-08-31 14:52:32 +02:00
parent ce9ad8b970
commit 5fb17dbf9e
4 changed files with 7 additions and 3 deletions

View File

@@ -225,6 +225,10 @@ export const ConversationContainer = (props: Props) => {
}
const autoScrollToBottom = (offsetTop?: number) => {
const chunks = chatChunks()
const lastChunkWasStreaming =
chunks.length >= 2 && chunks[chunks.length - 2].streamingMessageId
if (lastChunkWasStreaming) return
setTimeout(() => {
chatContainer?.scrollTo(0, offsetTop ?? chatContainer.scrollHeight)
}, 50)