From aeaaa6f1acabca9be69bf269a08e3380515a8f5f Mon Sep 17 00:00:00 2001 From: Faton Ramadani Date: Mon, 20 Mar 2023 09:49:11 +0100 Subject: [PATCH] fix(frontend): add missing optional chaining (#1306) --- .../editor/settingsPanel/InputsSpecEditor.svelte | 16 ++++++++-------- .../settingsPanel/InputsSpecsEditor.svelte | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/InputsSpecEditor.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/InputsSpecEditor.svelte index 1d0324c465..a41fddc12e 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/InputsSpecEditor.svelte @@ -33,7 +33,7 @@ const { connectingInput } = getContext('AppViewerContext') -{#if componentInput.ctype == undefined} +{#if componentInput?.ctype == undefined} {#if !(resourceOnly && (fieldType !== 'object' || !format?.startsWith('resource-')))}
@@ -53,7 +53,7 @@ : capitalize(fieldTypeToTsType(fieldType))} - {#if !onlyStatic && componentInput.type != 'eval'} + {#if !onlyStatic && componentInput.type && componentInput.type != 'eval'} { @@ -115,11 +115,11 @@
- {#if componentInput.type === 'connected'} + {#if componentInput?.type === 'connected'} - {:else if componentInput.type === 'row'} + {:else if componentInput?.type === 'row'} - {:else if componentInput.type === 'static'} + {:else if componentInput?.type === 'static'} - {:else if componentInput.type === 'eval'} + {:else if componentInput?.type === 'eval'} - {:else if componentInput.type === 'upload'} + {:else if componentInput?.type === 'upload'} - {:else if componentInput.type === 'user'} + {:else if componentInput?.type === 'user'} Field's value is set by the user {/if} diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte index 1a4208cfa4..b5fc8d889b 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte @@ -15,7 +15,7 @@ {#if inputSpecs}
{#each Object.keys(inputSpecsConfiguration) as k} - {#if inputSpecs[k].ctype == undefined} + {#if inputSpecs[k]?.ctype == undefined} {@const meta = inputSpecsConfiguration?.[k]}