From ec24db21bd3adb374772768763be9c4562996029 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Wed, 25 Sep 2024 16:00:24 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20persistence=20issue=20when?= =?UTF-8?q?=20user=20remembered?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/embeds/js/package.json | 2 +- packages/embeds/js/src/utils/persist.ts | 2 ++ packages/embeds/nextjs/package.json | 2 +- packages/embeds/react/package.json | 2 +- turbo.json | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/embeds/js/package.json b/packages/embeds/js/package.json index ba5d6aab37..f0b805dfb0 100644 --- a/packages/embeds/js/package.json +++ b/packages/embeds/js/package.json @@ -1,6 +1,6 @@ { "name": "@typebot.io/js", - "version": "0.3.15", + "version": "0.3.16", "description": "Javascript library to display typebots on your website", "license": "AGPL-3.0-or-later", "type": "module", diff --git a/packages/embeds/js/src/utils/persist.ts b/packages/embeds/js/src/utils/persist.ts index f999436d70..1904661ecd 100644 --- a/packages/embeds/js/src/utils/persist.ts +++ b/packages/embeds/js/src/utils/persist.ts @@ -26,6 +26,8 @@ export function persist( const serialize: (data: T) => string = (data: T) => { const clonedData = JSON.parse(JSON.stringify(data)); + if (typeof clonedData !== "object") return JSON.stringify(clonedData); + if ("blobUrl" in clonedData) { clonedData.blobUrl = undefined; } diff --git a/packages/embeds/nextjs/package.json b/packages/embeds/nextjs/package.json index b59d9fa076..5496ee52a7 100644 --- a/packages/embeds/nextjs/package.json +++ b/packages/embeds/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@typebot.io/nextjs", - "version": "0.3.15", + "version": "0.3.16", "license": "AGPL-3.0-or-later", "description": "Convenient library to display typebots on your Next.js website", "type": "module", diff --git a/packages/embeds/react/package.json b/packages/embeds/react/package.json index 0ee47c7db6..d7be403aba 100644 --- a/packages/embeds/react/package.json +++ b/packages/embeds/react/package.json @@ -1,6 +1,6 @@ { "name": "@typebot.io/react", - "version": "0.3.15", + "version": "0.3.16", "description": "Convenient library to display typebots on your React app", "license": "AGPL-3.0-or-later", "type": "module", diff --git a/turbo.json b/turbo.json index 762b026c3f..ce4b61e1fd 100644 --- a/turbo.json +++ b/turbo.json @@ -5,7 +5,7 @@ "globalPassThroughEnv": ["ENCRYPTION_SECRET"], "tasks": { "dev": { - "dependsOn": ["^db:generate", "@typebot.io/react#build"], + "dependsOn": ["^db:generate", "^db:push", "@typebot.io/react#build"], "persistent": true }, "build": {