fix(ui): fix node value checks to compare to undefined

existing checks would fail if falsy values
This commit is contained in:
psychedelicious 2023-09-04 10:22:36 +10:00
parent 1062fc4796
commit 09803b075d
2 changed files with 6 additions and 2 deletions

View File

@ -63,7 +63,11 @@ const selector = createSelector(
return; return;
} }
if (fieldTemplate.required && !field.value && !hasConnection) { if (
fieldTemplate.required &&
field.value === undefined &&
!hasConnection
) {
reasons.push( reasons.push(
`${node.data.label || nodeTemplate.title} -> ${ `${node.data.label || nodeTemplate.title} -> ${
field.label || fieldTemplate.title field.label || fieldTemplate.title

View File

@ -15,7 +15,7 @@ export const useDoesInputHaveValue = (nodeId: string, fieldName: string) => {
if (!isInvocationNode(node)) { if (!isInvocationNode(node)) {
return; return;
} }
return Boolean(node?.data.inputs[fieldName]?.value); return node?.data.inputs[fieldName]?.value !== undefined;
}, },
defaultSelectorOptions defaultSelectorOptions
), ),