From 320cffc42001399e2a646243ba9d6ab632a6f9e8 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Wed, 26 Jul 2023 17:28:45 +0200 Subject: [PATCH] :bug: (embed) Remove at functions for better compability --- packages/embeds/js/package.json | 2 +- .../ConversationContainer/ConversationContainer.tsx | 4 ++-- packages/embeds/nextjs/package.json | 2 +- packages/embeds/react/package.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/embeds/js/package.json b/packages/embeds/js/package.json index 06308c095a..621ca9687c 100644 --- a/packages/embeds/js/package.json +++ b/packages/embeds/js/package.json @@ -1,6 +1,6 @@ { "name": "@typebot.io/js", - "version": "0.1.8", + "version": "0.1.10", "description": "Javascript library to display typebots on your website", "type": "module", "main": "dist/index.js", diff --git a/packages/embeds/js/src/components/ConversationContainer/ConversationContainer.tsx b/packages/embeds/js/src/components/ConversationContainer/ConversationContainer.tsx index 38f47b1fc7..abe640c66e 100644 --- a/packages/embeds/js/src/components/ConversationContainer/ConversationContainer.tsx +++ b/packages/embeds/js/src/components/ConversationContainer/ConversationContainer.tsx @@ -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, diff --git a/packages/embeds/nextjs/package.json b/packages/embeds/nextjs/package.json index a91a283678..9a4ea3ccf8 100644 --- a/packages/embeds/nextjs/package.json +++ b/packages/embeds/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@typebot.io/nextjs", - "version": "0.1.8", + "version": "0.1.10", "description": "Convenient library to display typebots on your Next.js website", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/embeds/react/package.json b/packages/embeds/react/package.json index 1a27907295..0b498ef8df 100644 --- a/packages/embeds/react/package.json +++ b/packages/embeds/react/package.json @@ -1,6 +1,6 @@ { "name": "@typebot.io/react", - "version": "0.1.8", + "version": "0.1.10", "description": "Convenient library to display typebots on your Next.js website", "main": "dist/index.js", "types": "dist/index.d.ts",