better preprocessing fix

This commit is contained in:
Ruben Fiszel
2025-08-20 18:06:57 +00:00
parent 47e49b243d
commit aa5a0300f4
2 changed files with 10 additions and 7 deletions
@@ -1,7 +1,7 @@
<script lang="ts">
import type { Schema } from '$lib/common'
import { allTrue } from '$lib/utils'
import { allTrue, sendUserToast } from '$lib/utils'
import { RefreshCw } from 'lucide-svelte'
import ArgInput from './ArgInput.svelte'
import { Button } from './common'
@@ -101,8 +101,11 @@
let args = $state(<Record<string, any>>{})
onMount(() => {
if (!testSteps) {
sendUserToast('testSteps module not initialized. Preview will not work.', true)
}
testSteps?.updateStepArgs(mod.id, flowStateStore.val, flowStore?.val, previewArgs?.val)
args = testSteps?.getStepArgs(mod.id) ?? { value: {} }
args = testSteps?.getStepArgs(mod.id)
})
</script>
@@ -21,7 +21,11 @@ export class TestSteps {
this.#steps[moduleId].value = args
}
getStepArgs(moduleId: string): ModuleArgs | undefined {
getStepArgs(moduleId: string): ModuleArgs {
let args = this.#steps[moduleId]
if (!args) {
this.#steps[moduleId] = { value: {} }
}
return this.#steps[moduleId]
}
@@ -143,10 +147,6 @@ export class TestSteps {
flow: OpenFlow | undefined,
previewArgs: Record<string, any> | undefined
) {
if (id == 'preprocessor') {
this.#steps[id] = { value: {} }
return
}
if (!flowState || !flow) {
return
}