Skip to content

Commit 3aee9e7

Browse files
committed
🚸 On chat state recover, don't execute client side actions
1 parent 69446ad commit 3aee9e7

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

packages/embeds/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@typebot.io/js",
3-
"version": "0.2.60",
3+
"version": "0.2.61",
44
"description": "Javascript library to display typebots on your website",
55
"type": "module",
66
"main": "dist/index.js",

packages/embeds/js/src/components/ConversationContainer/ConversationContainer.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ export const ConversationContainer = (props: Props) => {
248248
const processClientSideActions = async (
249249
actions: NonNullable<ContinueChatResponse['clientSideActions']>
250250
) => {
251+
if (isRecovered()) return
251252
for (const action of actions) {
252253
if (
253254
'streamOpenAiChatCompletion' in action ||
@@ -302,10 +303,7 @@ export const ConversationContainer = (props: Props) => {
302303
(chatChunk.messages.length > 0 && isSending()))
303304
}
304305
hasError={hasError() && index() === chatChunks().length - 1}
305-
isTransitionDisabled={
306-
index() !== chatChunks().length - 1 ||
307-
(!chatChunk.input && isRecovered())
308-
}
306+
isTransitionDisabled={index() !== chatChunks().length - 1}
309307
onNewBubbleDisplayed={handleNewBubbleDisplayed}
310308
onAllBubblesDisplayed={handleAllBubblesDisplayed}
311309
onSubmit={sendMessage}

packages/embeds/nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@typebot.io/nextjs",
3-
"version": "0.2.60",
3+
"version": "0.2.61",
44
"description": "Convenient library to display typebots on your Next.js website",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

packages/embeds/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@typebot.io/react",
3-
"version": "0.2.60",
3+
"version": "0.2.61",
44
"description": "Convenient library to display typebots on your React app",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

0 commit comments

Comments
 (0)