From dfa472aadf05d85fbd08e843c872a5d02ddbdc95 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sun, 21 Jan 2024 18:48:35 +0100 Subject: [PATCH] make appeditor & preview resilient to no css --- frontend/src/lib/components/apps/editor/AppEditor.svelte | 4 +++- frontend/src/lib/components/apps/editor/AppPreview.svelte | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/apps/editor/AppEditor.svelte b/frontend/src/lib/components/apps/editor/AppEditor.svelte index 05e8ca4c52..ac8b295a7a 100644 --- a/frontend/src/lib/components/apps/editor/AppEditor.svelte +++ b/frontend/src/lib/components/apps/editor/AppEditor.svelte @@ -412,7 +412,9 @@ css = currentAppStore.theme.css } else if (currentAppStore.theme.type === 'path' && currentAppStore.theme?.path) { let loadedCss = await getTheme($workspaceStore!, currentAppStore.theme.path) - css = loadedCss.value + if (loadedCss) { + css = loadedCss.value + } } lastTheme = JSON.stringify(currentAppStore.theme) } diff --git a/frontend/src/lib/components/apps/editor/AppPreview.svelte b/frontend/src/lib/components/apps/editor/AppPreview.svelte index 326e8d79b2..542f60e973 100644 --- a/frontend/src/lib/components/apps/editor/AppPreview.svelte +++ b/frontend/src/lib/components/apps/editor/AppPreview.svelte @@ -133,7 +133,9 @@ css = currentAppStore.theme.css } else if (currentAppStore.theme.type === 'path' && currentAppStore.theme.path) { let loadedCss = await getTheme(workspace, currentAppStore.theme.path) - css = loadedCss.value + if (loadedCss) { + css = loadedCss.value + } } }