From 55eb48c55332431304cedbf3bcbbbcff61ec3645 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 2 Mar 2023 17:54:05 +0100 Subject: [PATCH] fix(frontend): background script not showing inputs --- .../components/apps/editor/SettingsPanel.svelte | 16 +++++++++------- .../inlineScriptsPanel/InlineScriptEditor.svelte | 3 +++ .../inlineScriptsPanel/InlineScriptsPanel.svelte | 2 ++ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/frontend/src/lib/components/apps/editor/SettingsPanel.svelte b/frontend/src/lib/components/apps/editor/SettingsPanel.svelte index ba283f18eb..6c17ef905c 100644 --- a/frontend/src/lib/components/apps/editor/SettingsPanel.svelte +++ b/frontend/src/lib/components/apps/editor/SettingsPanel.svelte @@ -5,7 +5,7 @@ import PanelSection from './settingsPanel/common/PanelSection.svelte' import InputsSpecsEditor from './settingsPanel/InputsSpecsEditor.svelte' - const { selectedComponent, app } = getContext('AppEditorContext') + const { selectedComponent, app, stateId } = getContext('AppEditorContext') {#if $app.grid} @@ -21,12 +21,14 @@ {#each $app?.hiddenInlineScripts ?? [] as script, index (script.name)} {#if $selectedComponent === `bg_${index}`} - + {#key $stateId} + + {/key} {/if} {/each} diff --git a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte index f580b9c29f..eaf3bf7c46 100644 --- a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +++ b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte @@ -55,6 +55,9 @@ emptySchema() ) } + if (inlineScript.schema) { + loadSchemaAndInputsByName() + } }) const dispatch = createEventDispatcher() let runLoading = false diff --git a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte index b0c5f5be3f..0360e83cac 100644 --- a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +++ b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte @@ -95,6 +95,8 @@ id={`bg_${index}`} bind:inlineScript={hiddenInlineScript.inlineScript} bind:name={hiddenInlineScript.name} + bind:fields={hiddenInlineScript.fields} + syncFields on:delete={() => { // remove the script from the array at the index $app.hiddenInlineScripts.splice(index, 1)