From c20d6bf971b932e0a76c193834beb8b15ad4580d Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Tue, 8 Jul 2025 22:46:42 +0000 Subject: [PATCH] fix: fix isValid state when schema is empty --- frontend/src/lib/components/Editor.svelte | 2 +- frontend/src/lib/components/Path.svelte | 4 ++-- .../triggers/schedules/ScheduleEditorInner.svelte | 8 +++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend/src/lib/components/Editor.svelte b/frontend/src/lib/components/Editor.svelte index 2420b6e0df..bd1eba2a80 100644 --- a/frontend/src/lib/components/Editor.svelte +++ b/frontend/src/lib/components/Editor.svelte @@ -241,7 +241,7 @@ ) { return randomHash() } else { - console.log('path', path) + // console.log('path', path) return path as string } } diff --git a/frontend/src/lib/components/Path.svelte b/frontend/src/lib/components/Path.svelte index 16bf6d027f..2d2abd8c18 100644 --- a/frontend/src/lib/components/Path.svelte +++ b/frontend/src/lib/components/Path.svelte @@ -337,11 +337,11 @@ 'openSearchWithPrefilledText' ) - $effect(() => { + $effect.pre(() => { ;[meta?.name, meta?.owner, meta?.ownerKind] meta && untrack(() => onMetaChange()) }) - $effect(() => { + $effect.pre(() => { if ($workspaceStore && $userStore) { untrack(() => { loadFolders() diff --git a/frontend/src/lib/components/triggers/schedules/ScheduleEditorInner.svelte b/frontend/src/lib/components/triggers/schedules/ScheduleEditorInner.svelte index c4b86a01bd..efe399aa0b 100644 --- a/frontend/src/lib/components/triggers/schedules/ScheduleEditorInner.svelte +++ b/frontend/src/lib/components/triggers/schedules/ScheduleEditorInner.svelte @@ -335,7 +335,12 @@ }) function setDefaultValid(schema: Record | undefined) { - isValid = schema?.properties && Object.keys(schema.properties).length === 0 + if (!isValid) { + let isEmpty = schema?.properties == undefined || Object.keys(schema.properties).length === 0 + if (isEmpty) { + isValid = true + } + } } async function loadScript(p: string | undefined): Promise { @@ -680,6 +685,7 @@ }) + {#snippet saveButton()} {#if !drawerLoading}