Fix verticesLayers assignment bug
This commit is contained in:
parent
96c5db6589
commit
cdb59132d3
1 changed files with 5 additions and 0 deletions
|
|
@ -78,6 +78,8 @@ export async function updateVerticesOrder(
|
||||||
// If the targetId is not found, include the entire inner array
|
// If the targetId is not found, include the entire inner array
|
||||||
verticesLayers.push(innerArray);
|
verticesLayers.push(innerArray);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
verticesLayers = verticesOrder;
|
||||||
}
|
}
|
||||||
const verticesIds = verticesOrder.flat();
|
const verticesIds = verticesOrder.flat();
|
||||||
useFlowStore.getState().updateVerticesBuild({
|
useFlowStore.getState().updateVerticesBuild({
|
||||||
|
|
@ -101,9 +103,11 @@ export async function buildVertices({
|
||||||
validateNodes,
|
validateNodes,
|
||||||
}: BuildVerticesParams) {
|
}: BuildVerticesParams) {
|
||||||
let verticesBuild = useFlowStore.getState().verticesBuild;
|
let verticesBuild = useFlowStore.getState().verticesBuild;
|
||||||
|
|
||||||
if (!verticesBuild || nodeId) {
|
if (!verticesBuild || nodeId) {
|
||||||
verticesBuild = await updateVerticesOrder(flowId, nodeId);
|
verticesBuild = await updateVerticesOrder(flowId, nodeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
const verticesIds = verticesBuild?.verticesIds!;
|
const verticesIds = verticesBuild?.verticesIds!;
|
||||||
const verticesLayers = verticesBuild?.verticesLayers!;
|
const verticesLayers = verticesBuild?.verticesLayers!;
|
||||||
const runId = verticesBuild?.runId!;
|
const runId = verticesBuild?.runId!;
|
||||||
|
|
@ -124,6 +128,7 @@ export async function buildVertices({
|
||||||
|
|
||||||
// Set each vertex state to building
|
// Set each vertex state to building
|
||||||
const buildResults: Array<boolean> = [];
|
const buildResults: Array<boolean> = [];
|
||||||
|
console.log(verticesLayers);
|
||||||
for (const layer of verticesLayers) {
|
for (const layer of verticesLayers) {
|
||||||
if (onBuildStart) onBuildStart(layer);
|
if (onBuildStart) onBuildStart(layer);
|
||||||
for (const id of layer) {
|
for (const id of layer) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue