🐛 (embed) Remove at functions for better compability

This commit is contained in:
Baptiste Arnaud
2023-07-26 17:28:45 +02:00
parent 5dc01db082
commit 320cffc420
4 changed files with 5 additions and 5 deletions

View File

@@ -106,7 +106,7 @@ export const ConversationContainer = (props: Props) => {
const streamMessage = (content: string) => {
setIsSending(false)
const lastChunk = chatChunks().at(-1)
const lastChunk = [...chatChunks()].pop()
if (!lastChunk) return
const id = lastChunk.streamingMessageId ?? createUniqueId()
if (!lastChunk.streamingMessageId)
@@ -202,7 +202,7 @@ export const ConversationContainer = (props: Props) => {
...displayedChunks,
{
input: data.input,
messages: chatChunks().at(-1)?.streamingMessageId
messages: [...chatChunks()].pop()?.streamingMessageId
? data.messages.slice(1)
: data.messages,
clientSideActions: data.clientSideActions,