From 8f7a11b8964e2c3405ce3689f9cf2298f9e71c75 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 5 Apr 2023 19:31:12 +0200 Subject: [PATCH] feat(frontend): add workspace to ctx --- frontend/src/lib/components/apps/editor/AppEditor.svelte | 3 ++- frontend/src/lib/components/apps/editor/AppPreview.svelte | 4 ++-- frontend/src/routes/(root)/(logged)/+page.svelte | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/lib/components/apps/editor/AppEditor.svelte b/frontend/src/lib/components/apps/editor/AppEditor.svelte index 462227f221..5829c9fa63 100644 --- a/frontend/src/lib/components/apps/editor/AppEditor.svelte +++ b/frontend/src/lib/components/apps/editor/AppEditor.svelte @@ -70,7 +70,8 @@ email: $userStore?.email, username: $userStore?.username, query: Object.fromEntries($page.url.searchParams.entries()), - hash: $page.url.hash + hash: $page.url.hash, + workspace: $workspaceStore } const worldStore = buildWorld(context) diff --git a/frontend/src/lib/components/apps/editor/AppPreview.svelte b/frontend/src/lib/components/apps/editor/AppPreview.svelte index ec490b983c..404e8df823 100644 --- a/frontend/src/lib/components/apps/editor/AppPreview.svelte +++ b/frontend/src/lib/components/apps/editor/AppPreview.svelte @@ -73,7 +73,7 @@ allIdsInPath }) - let ncontext = context + let ncontext: any = { ...context, workspace } function hashchange(e: HashChangeEvent) { ncontext.hash = e.newURL.split('#')[1] @@ -98,7 +98,7 @@
{#if $appStore.grid} diff --git a/frontend/src/routes/(root)/(logged)/+page.svelte b/frontend/src/routes/(root)/(logged)/+page.svelte index 44f66cad59..6575a03933 100644 --- a/frontend/src/routes/(root)/(logged)/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/+page.svelte @@ -160,7 +160,7 @@ isEditor={false} context={{ username: $userStore?.username ?? 'anonymous', - email: $userStore?.email ?? 'anonymous' + email: $userStore?.email ?? 'anonymous', }} summary={appViewerApp?.app.summary ?? ''} noBackend