Skip to content

Commit

Permalink
fix: Only show error state on components w/ errors for node validation (
Browse files Browse the repository at this point in the history
langflow-ai#3968)

* Only show error state on components w/ errors for node validation

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and diogocabral committed Nov 26, 2024
1 parent c86affe commit dd77615
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/frontend/src/utils/reactflowUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,11 @@ Array<{ id: string; errors: Array<string> }> {
];
}
// validateNode(n, edges) returns an array of errors for the node
return nodes.map((n) => ({ id: n.id, errors: validateNode(n, edges) }));
const nodeMap = nodes.map((n) => ({
id: n.id,
errors: validateNode(n, edges),
}));
return nodeMap.filter((n) => n.errors?.length);
}

export function updateEdges(edges: Edge[]) {
Expand Down

0 comments on commit dd77615

Please sign in to comment.