Skip to content

Commit

Permalink
Update src/ui/src/components/workflows/WorkflowsWorkflow.vue
Browse files Browse the repository at this point in the history
Co-authored-by: Alexandre Rousseau <[email protected]>
  • Loading branch information
ramedina86 and madeindjs authored Sep 30, 2024
1 parent 1ed99a0 commit cde86a1
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/ui/src/components/workflows/WorkflowsWorkflow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,12 @@ watch(
// Remove references when a node is deleted
const preIds = preChildren.map((c) => c.id);
const postIds = postChildren.map((c) => c.id);
const removedIds = preIds.filter((cId) => !postIds.includes(cId));
removedIds.forEach((removedId) => {
postChildren.forEach((c) => {
if (!c.outs || c.outs.length == 0) return;
c.outs = c.outs.filter((out) => out.toNodeId !== removedId);
});
const removedIds = new Set(postChildren.map((c) => c.id));
preChildren.forEach(c => removedIds.delete(c.id));
postChildren.forEach((c) => {
c.outs = c.outs?.filter((out) => !removedIds.has(out.toNodeId));
});
});
if (removedIds.length > 0) {
Expand Down

0 comments on commit cde86a1

Please sign in to comment.