diff --git a/src/UI/Popup/TagRendering/TagRenderingQuestion.svelte b/src/UI/Popup/TagRendering/TagRenderingQuestion.svelte index b67c17b45..fbcc2d3a0 100644 --- a/src/UI/Popup/TagRendering/TagRenderingQuestion.svelte +++ b/src/UI/Popup/TagRendering/TagRenderingQuestion.svelte @@ -54,7 +54,7 @@ */ let checkedMappings: boolean[] - let mappings: Mapping[] = config?.mappings + let mappings: Mapping[] = config?.mappings ?? [] let searchTerm: UIEventSource = new UIEventSource("") let dispatch = createEventDispatcher<{ @@ -153,7 +153,7 @@ } }) $: { - if (allowDeleteOfFreeform && $freeformInput === undefined && $freeformInputUnvalidated === "" && mappings.length === 0) { + if (allowDeleteOfFreeform && $freeformInput === undefined && $freeformInputUnvalidated === "" && mappings?.length === 0) { selectedTags = new Tag(config.freeform.key, "") } else { @@ -172,8 +172,6 @@ } function onSave(e = undefined, deleteFreeform = false) { - console.log("On click", deleteFreeform, ">>>", selectedTags) - if (selectedTags === undefined) { return } @@ -396,7 +394,7 @@ - {#if allowDeleteOfFreeform && mappings.length === 0 && $freeformInput === undefined && $freeformInputUnvalidated === ""} + {#if allowDeleteOfFreeform && mappings?.length === 0 && $freeformInput === undefined && $freeformInputUnvalidated === ""}