fix: static is undefined by default instead of being empty ''

This commit is contained in:
Ruben Fiszel
2022-07-23 23:16:53 +02:00
parent 656e0acfc1
commit 8a951e8821
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -60,8 +60,8 @@
{#if runnable?.schema}
{#if detailed}
<h2>
Arguments<Tooltip class="px-2 mb-6"
>Optioal fields, if left blank, will use the placeholder value as default.</Tooltip
Arguments <Tooltip
>The optional fields, if left blank, will use the placeholder value as default.</Tooltip
>
</h2>
{/if}
+3 -3
View File
@@ -8,9 +8,7 @@ import {
} from '$lib/gen'
import { inferArgs } from '$lib/infer'
import { loadSchema } from '$lib/scripts'
import { workspaceStore } from '$lib/stores'
import { emptySchema, getScriptByPath } from '$lib/utils'
import { get } from 'svelte/store'
import type { FlowMode } from './flowStore'
export function flowToMode(flow: Flow, mode: FlowMode): Flow {
@@ -18,10 +16,12 @@ export function flowToMode(flow: Flow, mode: FlowMode): Flow {
const newFlow: Flow = JSON.parse(JSON.stringify(flow))
const triggerModule = newFlow.value.modules[0]
const oldModules = newFlow.value.modules.slice(1)
if (triggerModule) {
triggerModule.stop_after_if_expr = 'result.res1.length == 0'
triggerModule.skip_if_stopped = true
}
newFlow.value.modules = newFlow.value.modules.slice(0, 1)
if (oldModules.length > 0) {
newFlow.value.modules.push({
@@ -127,7 +127,7 @@ export async function loadSchemaFromModule(module: FlowModule): Promise<{
input_transform = keys.reduce((accu, key) => {
accu[key] = {
type: 'static',
value: ''
value: undefined
}
return accu
}, {})