fix: fix isValid state when schema is empty

This commit is contained in:
Ruben Fiszel
2025-07-08 22:46:42 +00:00
parent 86223dd8f3
commit c20d6bf971
3 changed files with 10 additions and 4 deletions
+1 -1
View File
@@ -241,7 +241,7 @@
) {
return randomHash()
} else {
console.log('path', path)
// console.log('path', path)
return path as string
}
}
+2 -2
View File
@@ -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()
@@ -335,7 +335,12 @@
})
function setDefaultValid(schema: Record<string, any> | 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<void> {
@@ -680,6 +685,7 @@
})
</script>
<!-- {JSON.stringify({ allowSchedule, path: script_path, validCRON, isValid })} -->
{#snippet saveButton()}
{#if !drawerLoading}
<TriggerEditorToolbar