From a626aa61752b7bf4e1e01b03baca379ae931b359 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 12 Jan 2023 12:51:27 +0100 Subject: [PATCH] minor app fixes --- .../apps/components/form/AppForm.svelte | 7 ++++--- .../src/routes/(root)/(logged)/+layout.svelte | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/frontend/src/lib/components/apps/components/form/AppForm.svelte b/frontend/src/lib/components/apps/components/form/AppForm.svelte index 45e80837f5..df2dd78688 100644 --- a/frontend/src/lib/components/apps/components/form/AppForm.svelte +++ b/frontend/src/lib/components/apps/components/form/AppForm.svelte @@ -29,7 +29,8 @@ let isLoading: boolean = false - $: noInputs = componentInput?.type != 'runnable' || Object.values(componentInput?.fields ?? {}).filter((x) => x.type == 'user').length == 0 + $: noInputs = + componentInput?.type != 'runnable' || Object.keys(componentInput?.fields ?? {}).length == 0 $: outputs = $worldStore?.outputsById[id] as { result: Output> @@ -68,8 +69,8 @@ {#if noInputs}
Run forms are associated with a runnable that has user inputs. -
- Once a script or flow is chosen, set some Runnable Inputs to +
+ Once a script or flow is chosen, set some Runnable Inputs to User Input diff --git a/frontend/src/routes/(root)/(logged)/+layout.svelte b/frontend/src/routes/(root)/(logged)/+layout.svelte index c4309348e1..bb3dbd65c7 100644 --- a/frontend/src/routes/(root)/(logged)/+layout.svelte +++ b/frontend/src/routes/(root)/(logged)/+layout.svelte @@ -86,10 +86,18 @@ isCollapsed = true } }) - $: if (innerWidth < 1248 && innerWidth >= 768) { - isCollapsed = true - } else if ((innerWidth >= 1248 || innerWidth < 768) && !$page.url.pathname.startsWith('/apps')) { - isCollapsed = false + + $: innerWidth && changeCollapsed() + + function changeCollapsed() { + if (innerWidth < 1248 && innerWidth >= 768) { + isCollapsed = true + } else if ( + (innerWidth >= 1248 || innerWidth < 768) && + !$page.url.pathname.startsWith('/apps') + ) { + isCollapsed = false + } }