From 08ec8ca7dbc4da81a120ba52e255b606a3c0975b Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 24 Feb 2022 12:25:14 +0000 Subject: [PATCH 1/2] Always update asset type when required, even if no assets of that type exist --- .../app/[application]/design/[assetType]/index.svelte | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/builder/src/pages/builder/app/[application]/design/[assetType]/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[assetType]/index.svelte index a767b56b4f..444835de22 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[assetType]/index.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[assetType]/index.svelte @@ -45,6 +45,14 @@ store.actions.screens.select(id) } } + + // If we didn't find a valid asset, just update the preview type + if (!id) { + store.update(state => { + state.currentFrontEndType = assetType + return state + }) + } } From fd76551909f469edb05faf35f2d4121beff63d9f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 24 Feb 2022 12:26:31 +0000 Subject: [PATCH 2/2] Key client app layout rendering by builder store asset type to ensure preview is always remounted properly --- packages/client/src/components/ClientApp.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index 5bd5d2d46f..06b240f3ee 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -108,7 +108,7 @@
- {#key $screenStore.activeLayout._id} + {#key `${$screenStore.activeLayout._id}-${$builderStore.previewType}`}