From 12fec27eaa32c8ca3a0a47af755fee7eceba83d1 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sat, 28 Oct 2023 20:54:59 +0200 Subject: [PATCH] fix resource picker in some rare context --- frontend/src/lib/components/ArgInput.svelte | 2 +- .../settingsPanel/inputEditor/StaticInputEditor.svelte | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/lib/components/ArgInput.svelte b/frontend/src/lib/components/ArgInput.svelte index d91c14680d..f2b22d2434 100644 --- a/frontend/src/lib/components/ArgInput.svelte +++ b/frontend/src/lib/components/ArgInput.svelte @@ -434,7 +434,7 @@ 1 + resourceType={format && format.split('-').length > 1 ? format.substring('resource-'.length) : undefined} {showSchemaExplorer} diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte index e4e80cdf28..0e0109e3d3 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte @@ -57,7 +57,7 @@ {:else if fieldType === 'tab-select'} {:else if fieldType === 'labeledresource'} - {#if componentInput?.value && typeof componentInput?.value == 'object' && 'label' in componentInput?.value} + {#if componentInput?.value && typeof componentInput?.value == 'object' && 'label' in componentInput?.value && (componentInput.value?.['value'] == undefined || typeof componentInput.value?.['value'] == 'string')}
{ let path = e.detail if (componentInput) { @@ -86,9 +86,9 @@ {:else if fieldType === 'color'} {:else if fieldType === 'object' || fieldType == 'labeledselect'} - {#if format?.startsWith('resource-')} + {#if format?.startsWith('resource-') && (componentInput.value == undefined || typeof componentInput.value == 'string')} { let path = e.detail if (componentInput) { @@ -99,7 +99,7 @@ } } }} - resourceType={format.split('-').length > 1 + resourceType={format && format?.split('-').length > 1 ? format.substring('resource-'.length) : undefined} showSchemaExplorer