2
0

🐛 Attempt to fix load crash on UC Browser

This commit is contained in:
Baptiste Arnaud
2023-02-25 19:15:43 +01:00
parent c889f302f6
commit 5dd87554c3
11 changed files with 33 additions and 25 deletions

View File

@ -67,7 +67,7 @@ export const ConversationContainer = (props: Props) => {
})
const sendMessage = async (message: string | undefined) => {
const currentBlockId = chatChunks().at(-1)?.input?.id
const currentBlockId = [...chatChunks()].pop()?.input?.id
if (currentBlockId && props.onAnswer && message)
props.onAnswer({ message, blockId: currentBlockId })
const longRequest = setTimeout(() => {
@ -116,7 +116,7 @@ export const ConversationContainer = (props: Props) => {
}
const handleAllBubblesDisplayed = async () => {
const lastChunk = chatChunks().at(-1)
const lastChunk = [...chatChunks()].pop()
if (!lastChunk) return
if (isNotDefined(lastChunk.input)) {
props.onEnd?.()
@ -124,7 +124,7 @@ export const ConversationContainer = (props: Props) => {
}
const handleNewBubbleDisplayed = async (blockId: string) => {
const lastChunk = chatChunks().at(-1)
const lastChunk = [...chatChunks()].pop()
if (!lastChunk) return
if (lastChunk.clientSideActions) {
const actionsToExecute = lastChunk.clientSideActions.filter(