From 7d6cf2ad546837efc67b9b7de9a80d0f9485024f Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Thu, 11 Apr 2024 12:07:33 +0200 Subject: [PATCH] :bug: Wipe chat state from storage if disabled Closes #1429 --- packages/embeds/js/package.json | 2 +- packages/embeds/js/src/components/Bot.tsx | 1 + packages/embeds/nextjs/package.json | 2 +- packages/embeds/react/package.json | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/embeds/js/package.json b/packages/embeds/js/package.json index e9823a9fa1..ea1f9ffc50 100644 --- a/packages/embeds/js/package.json +++ b/packages/embeds/js/package.json @@ -1,6 +1,6 @@ { "name": "@typebot.io/js", - "version": "0.2.68", + "version": "0.2.69", "description": "Javascript library to display typebots on your website", "type": "module", "main": "dist/index.js", diff --git a/packages/embeds/js/src/components/Bot.tsx b/packages/embeds/js/src/components/Bot.tsx index 15c35b9871..53837048e9 100644 --- a/packages/embeds/js/src/components/Bot.tsx +++ b/packages/embeds/js/src/components/Bot.tsx @@ -146,6 +146,7 @@ export const Bot = (props: BotProps & { class?: string }) => { } props.onChatStatePersisted?.(true) } else { + wipeExistingChatStateInStorage(data.typebot.id) setInitialChatReply(data) if (data.input?.id && props.onNewInputBlock) props.onNewInputBlock(data.input) diff --git a/packages/embeds/nextjs/package.json b/packages/embeds/nextjs/package.json index 90e2e5a778..45bdb5a88e 100644 --- a/packages/embeds/nextjs/package.json +++ b/packages/embeds/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@typebot.io/nextjs", - "version": "0.2.68", + "version": "0.2.69", "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 c3785ac5a6..f2a64b0373 100644 --- a/packages/embeds/react/package.json +++ b/packages/embeds/react/package.json @@ -1,6 +1,6 @@ { "name": "@typebot.io/react", - "version": "0.2.68", + "version": "0.2.69", "description": "Convenient library to display typebots on your React app", "main": "dist/index.js", "types": "dist/index.d.ts",