diff --git a/src/lib/components/workspace/Models/ModelEditor.svelte b/src/lib/components/workspace/Models/ModelEditor.svelte
index 636048e8c7..ad164c0bdb 100644
--- a/src/lib/components/workspace/Models/ModelEditor.svelte
+++ b/src/lib/components/workspace/Models/ModelEditor.svelte
@@ -361,7 +361,7 @@
on:change={() => {
let reader = new FileReader();
reader.onload = (event) => {
- let originalImageUrl = `${event.target.result}`;
+ let originalImageUrl = `${event.target?.result}`;
const img = new Image();
img.src = originalImageUrl;
@@ -409,12 +409,12 @@
inputFiles &&
inputFiles.length > 0 &&
['image/gif', 'image/webp', 'image/jpeg', 'image/png', 'image/svg+xml'].includes(
- inputFiles[0]['type']
+ (inputFiles[0] as any)?.['type']
)
) {
reader.readAsDataURL(inputFiles[0]);
} else {
- console.log(`Unsupported File Type '${inputFiles[0]['type']}'.`);
+ console.log(`Unsupported File Type '${(inputFiles[0] as any)?.['type']}'.`);
inputFiles = null;
}
}}
@@ -713,22 +713,22 @@
-
+
- {#if $functions.filter((func) => func.type === 'filter').length > 0 || $functions.filter((func) => func.type === 'action').length > 0}
+ {#if ($functions ?? []).filter((func) => func.type === 'filter').length > 0 || ($functions ?? []).filter((func) => func.type === 'action').length > 0}
- {#if $functions.filter((func) => func.type === 'filter').length > 0}
+ {#if ($functions ?? []).filter((func) => func.type === 'filter').length > 0}
func.type === 'filter')}
+ filters={($functions ?? []).filter((func) => func.type === 'filter')}
/>
{#if filterIds.length > 0}
- {@const toggleableFilters = $functions.filter(
+ {@const toggleableFilters = ($functions ?? []).filter(
(func) =>
func.type === 'filter' &&
(filterIds.includes(func.id) || func?.is_global) &&
@@ -746,11 +746,11 @@
{/if}
{/if}
- {#if $functions.filter((func) => func.type === 'action').length > 0}
+ {#if ($functions ?? []).filter((func) => func.type === 'action').length > 0}
func.type === 'action')}
+ actions={($functions ?? []).filter((func) => func.type === 'action')}
/>
{/if}