fix issue with loop bindings showing for non loop steps

This commit is contained in:
Peter Clement 2024-09-20 11:53:48 +01:00
parent 069875e945
commit 7d4aa25244
1 changed files with 9 additions and 1 deletions

View File

@ -752,13 +752,21 @@
: allSteps[idx].icon
if (wasLoopBlock) {
loopBlockCount++
schema = cloneDeep(allSteps[idx - 1]?.schema?.outputs?.properties)
}
Object.entries(schema).forEach(([name, value]) => {
addBinding(name, value, icon, idx, isLoopBlock, bindingName)
})
}
if (
allSteps[blockIdx - 1]?.stepId !== ActionStepID.LOOP &&
allSteps
.slice(0, blockIdx)
.some(step => step.stepId === ActionStepID.LOOP)
) {
bindings = bindings.filter(x => !x.readableBinding.includes("loop"))
}
return bindings
}