0
0
Fork 0

perf: remove local tree variable

This commit is contained in:
Javier Segarra 2024-05-22 15:49:11 +02:00
parent f4807d887f
commit 3fded533a6
1 changed files with 2 additions and 3 deletions

View File

@ -99,14 +99,13 @@ watch(storeData, async (val) => {
nodes.value[0].children = [...val]; nodes.value[0].children = [...val];
const fetchedNodeKeys = val.flatMap(getNodeIds); const fetchedNodeKeys = val.flatMap(getNodeIds);
state.set('Tree', [...fetchedNodeKeys]); state.set('Tree', [...fetchedNodeKeys]);
const tree = state.get('Tree'); for (let n of state.get('Tree')) {
for (let n of tree) {
await fetchNodeLeaves(n); await fetchNodeLeaves(n);
} }
expanded.value = [null, 1, ...fetchedNodeKeys]; expanded.value = [null, 1, ...fetchedNodeKeys];
}); });
onMounted(async (n) => { onMounted(async () => {
const tree = [...state.get('Tree'), 1]; const tree = [...state.get('Tree'), 1];
const lastStateTree = state.get('TreeState'); const lastStateTree = state.get('TreeState');
if (tree) { if (tree) {