From 34a0c77d739e63e15876217f402238865bd32181 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 6 Apr 2022 13:40:07 +0100 Subject: [PATCH] Tidy up --- .../client/src/components/ClientApp.svelte | 27 +++++++++---------- packages/server/src/middleware/currentapp.js | 2 +- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index 9fe4506b3e..6525401c9c 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -63,10 +63,10 @@ // If using devtools, find the first screen matching our role if ($devToolsStore.role) { - firstRoute = - $screenStore.screens.filter( - screen => screen.routing?.roleId === $devToolsStore.role - )[0]?.routing?.route || "/" + const roleRoutes = $screenStore.screens.filter( + screen => screen.routing?.roleId === $devToolsStore.role + ) + firstRoute = roleRoutes[0]?.routing?.route || "/" } // Otherwise just use the fist route @@ -143,10 +143,10 @@ {/key} + Flatpickr needs to be inside the theme wrapper. + It also needs its own container because otherwise it hijacks + key events on the whole page. It is painful to work with. + -->
@@ -164,12 +164,10 @@
- - - + + {#if $appStore.isDevApp} + + {/if} {#if $builderStore.inBuilder || $devToolsStore.allowSelection} {/if} @@ -219,6 +217,7 @@ justify-content: flex-start; align-items: stretch; } + #app-body { flex: 1 1 auto; display: flex; diff --git a/packages/server/src/middleware/currentapp.js b/packages/server/src/middleware/currentapp.js index 2446b5030b..ad59186ebb 100644 --- a/packages/server/src/middleware/currentapp.js +++ b/packages/server/src/middleware/currentapp.js @@ -70,7 +70,7 @@ module.exports = async (ctx, next) => { const isDevApp = appId && isDevAppID(appId) const roleHeader = ctx.request.headers[Headers.PREVIEW_ROLE] if (isBuilder && isDevApp && roleHeader) { - // Ensure the role is valid ensuring a definition exists + // Ensure the role is valid by ensuring a definition exists try { await getRole(roleHeader) roleId = roleHeader