Refactor buildVertices function
This commit is contained in:
parent
b5577d5dac
commit
8c35df3808
1 changed files with 6 additions and 4 deletions
|
|
@ -36,6 +36,8 @@ export async function buildVertices({
|
||||||
// If the targetId is not found, include the entire inner array
|
// If the targetId is not found, include the entire inner array
|
||||||
vertices.push(innerArray);
|
vertices.push(innerArray);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
vertices = verticesOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
const buildResults: Array<boolean> = [];
|
const buildResults: Array<boolean> = [];
|
||||||
|
|
@ -57,10 +59,6 @@ export async function buildVertices({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
buildResults.push(buildData.valid);
|
buildResults.push(buildData.valid);
|
||||||
if (onBuildComplete) {
|
|
||||||
const allNodesValid = buildResults.every((result) => result);
|
|
||||||
onBuildComplete(allNodesValid);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (onBuildError) {
|
if (onBuildError) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|
@ -73,4 +71,8 @@ export async function buildVertices({
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (onBuildComplete) {
|
||||||
|
const allNodesValid = buildResults.every((result) => result);
|
||||||
|
onBuildComplete(allNodesValid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue