From c7f4978d05d1ce7c29f0c90d72f25266ff3c43a8 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 10 May 2022 18:43:34 +0100 Subject: [PATCH] Unset app ID from builder store when unmounting to prevent stale app ID header --- .../src/pages/builder/app/[application]/_layout.svelte | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/pages/builder/app/[application]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/_layout.svelte index 09b4a35f3c..c96880aa6a 100644 --- a/packages/builder/src/pages/builder/app/[application]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_layout.svelte @@ -7,7 +7,7 @@ import { API } from "api" import { isActive, goto, layout, redirect } from "@roxi/routify" import { capitalise } from "helpers" - import { onMount } from "svelte" + import { onMount, onDestroy } from "svelte" export let application @@ -66,6 +66,13 @@ hasSynced = true } }) + + onDestroy(() => { + store.update(state => { + state.appId = null + return state + }) + }) {#await promise}