Skip to content

Commit 862ba37

Browse files
committed
Simplify zooming after ELK layout
1 parent 2e8e4f0 commit 862ba37

File tree

1 file changed

+4
-13
lines changed
  • rust/cubesql/cubesql/egraph-debug-template/src

1 file changed

+4
-13
lines changed

rust/cubesql/cubesql/egraph-debug-template/src/index.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -162,23 +162,14 @@ async function layout(
162162
if (abortSignal.aborted) {
163163
return;
164164
}
165-
window.requestAnimationFrame(() => {
165+
// TODO investigate why setTimeout is necessary, something related to ReactFlow state and setNodes/setEdges probably
166+
setTimeout(() => {
166167
if (abortSignal.aborted) {
167168
return;
168169
}
169170

170-
if (navHistory?.length) {
171-
setTimeout(() => {
172-
if (abortSignal.aborted) {
173-
return;
174-
}
175-
176-
zoomTo(fitView, navHistory);
177-
}, 500);
178-
} else {
179-
fitView();
180-
}
181-
});
171+
zoomTo(fitView, navHistory);
172+
}, 500);
182173
return flatChildren;
183174
}
184175

0 commit comments

Comments
 (0)