Reset the builder store whenever unmounting the app root layout
This commit is contained in:
parent
47dc1ac540
commit
2c0af72cd4
|
@ -65,6 +65,9 @@ export const getFrontendStore = () => {
|
|||
const store = writable({ ...INITIAL_FRONTEND_STATE })
|
||||
|
||||
store.actions = {
|
||||
reset: () => {
|
||||
store.set({ ...INITIAL_FRONTEND_STATE })
|
||||
},
|
||||
initialise: async pkg => {
|
||||
const { layouts, screens, application, clientLibPath } = pkg
|
||||
const components = await fetchComponentLibDefinitions(application.appId)
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
import Logo from "assets/bb-emblem.svg"
|
||||
import { capitalise } from "helpers"
|
||||
import UpgradeModal from "../../../../components/upgrade/UpgradeModal.svelte"
|
||||
import { onMount } from "svelte"
|
||||
import { onMount, onDestroy } from "svelte"
|
||||
|
||||
// Get Package and set store
|
||||
export let application
|
||||
|
@ -81,6 +81,10 @@
|
|||
hasSynced = true
|
||||
}
|
||||
})
|
||||
|
||||
onDestroy(() => {
|
||||
store.actions.reset()
|
||||
})
|
||||
</script>
|
||||
|
||||
{#await promise}
|
||||
|
|
Loading…
Reference in New Issue