From 1c23dc3a3c739eba3b9fed4f61ba376b09f92a78 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 15 Dec 2021 09:00:14 +0000 Subject: [PATCH] Fix using wrong local storage key when persisting state in client apps --- packages/client/src/stores/state.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/stores/state.js b/packages/client/src/stores/state.js index 4ad31c3854..0297b4c532 100644 --- a/packages/client/src/stores/state.js +++ b/packages/client/src/stores/state.js @@ -1,9 +1,9 @@ import { writable, get, derived } from "svelte/store" import { localStorageStore } from "builder/src/builderStore/store/localStorage" -import { appStore } from "./app" const createStateStore = () => { - const localStorageKey = `${get(appStore).appId}.state` + const appId = window["##BUDIBASE_APP_ID##"] || "app" + const localStorageKey = `${appId}.state` const persistentStore = localStorageStore(localStorageKey, {}) // Initialise the temp store to mirror the persistent store