small fix for edge case

This commit is contained in:
Peter Clement 2024-09-13 16:03:37 +01:00
parent 7e767e4089
commit 04daa423cf
1 changed files with 6 additions and 4 deletions

View File

@ -62,6 +62,7 @@
} from "@budibase/types" } from "@budibase/types"
import { FIELDS } from "constants/backend" import { FIELDS } from "constants/backend"
import PropField from "./PropField.svelte" import PropField from "./PropField.svelte"
import { name } from "helpers/validation/yup/app"
export let block export let block
export let testData export let testData
@ -638,8 +639,7 @@
} }
/* End special cases for generating custom schemas based on triggers */ /* End special cases for generating custom schemas based on triggers */
let hasUserDefinedName = let hasUserDefinedName = automation.stepNames?.[allSteps[idx]?.id]
automation.stepNames?.[allSteps[idx - loopBlockCount]]?.id
if (isLoopBlock) { if (isLoopBlock) {
runtimeName = `loop.${name}` runtimeName = `loop.${name}`
} else if (block.name.startsWith("JS")) { } else if (block.name.startsWith("JS")) {
@ -756,10 +756,12 @@
loopBlockCount++ loopBlockCount++
schema = cloneDeep(allSteps[idx - 1]?.schema?.outputs?.properties) schema = cloneDeep(allSteps[idx - 1]?.schema?.outputs?.properties)
} }
Object.entries(schema).forEach(([name, value]) => Object.entries(schema).forEach(([name, value]) => {
addBinding(name, value, icon, idx, isLoopBlock, bindingName) addBinding(name, value, icon, idx, isLoopBlock, bindingName)
) })
console.log(bindings)
} }
console.log(bindings)
return bindings return bindings
} }