Skip to content

Commit d49fc93

Browse files
committed
2981 - don't populate nodes from tasks if workflow hasn't been fetched yet
1 parent 64b96c9 commit d49fc93

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

client/src/pages/platform/workflow-editor/hooks/useLayout.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,10 @@ export default function useLayout({
399399
});
400400

401401
useEffect(() => {
402+
if (!workflow) {
403+
return;
404+
}
405+
402406
let layoutNodes = allNodes;
403407
let edges: Edge[] = taskEdges;
404408

@@ -429,6 +433,7 @@ export default function useLayout({
429433
}));
430434

431435
const lastEdge = edges[edges.length - 1];
436+
432437
if (lastEdge && lastEdge.target === FINAL_PLACEHOLDER_NODE_ID) {
433438
edges.pop();
434439
}
@@ -457,7 +462,7 @@ export default function useLayout({
457462
});
458463

459464
// eslint-disable-next-line react-hooks/exhaustive-deps
460-
}, [canvasWidth, tasks, triggers]);
465+
}, [canvasWidth, tasks, triggers, workflow]);
461466

462467
useEffect(() => {
463468
if (canvasWidth > 0) {

0 commit comments

Comments
 (0)