1
0
Fork 0
mirror of synced 2024-07-02 13:01:09 +12:00

Fix using wrong local storage key when persisting state in client apps

This commit is contained in:
Andrew Kingston 2021-12-15 09:00:14 +00:00
parent 26d89f75d5
commit 1c23dc3a3c

View file

@ -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