🚑️ Fix chat remembered state restoration

We need to also persist the new totalChunksDisplayed signal in storage
This commit is contained in:
Baptiste Arnaud 2025-02-18 15:42:48 +01:00
parent 748252b19e
commit 40aa716d94
No known key found for this signature in database
4 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@typebot.io/js",
"version": "0.3.54",
"version": "0.3.55",
"description": "Javascript library to display typebots on your website",
"license": "FSL-1.1-ALv2",
"type": "module",

View File

@ -89,7 +89,13 @@ export const ConversationContainer = (props: Props) => {
key: `typebot-${props.context.typebot.id}-isEnded`,
storage: props.context.storage,
});
const [totalChunksDisplayed, setTotalChunksDisplayed] = createSignal(0);
const [totalChunksDisplayed, setTotalChunksDisplayed] = persist(
createSignal(0),
{
key: `typebot-${props.context.typebot.id}-totalChunksDisplayed`,
storage: props.context.storage,
},
);
const [dynamicTheme, setDynamicTheme] = createSignal<
ContinueChatResponse["dynamicTheme"]
>(props.initialChatReply.dynamicTheme);

View File

@ -1,6 +1,6 @@
{
"name": "@typebot.io/nextjs",
"version": "0.3.54",
"version": "0.3.55",
"license": "FSL-1.1-ALv2",
"description": "Convenient library to display typebots on your Next.js website",
"type": "module",

View File

@ -1,6 +1,6 @@
{
"name": "@typebot.io/react",
"version": "0.3.54",
"version": "0.3.55",
"description": "Convenient library to display typebots on your React app",
"license": "FSL-1.1-ALv2",
"type": "module",