From 3fded533a6b4d560724f101c2f6428a49b740eff Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Wed, 22 May 2024 15:49:11 +0200 Subject: [PATCH] perf: remove local tree variable --- src/pages/Zone/Card/ZoneLocationsTree.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pages/Zone/Card/ZoneLocationsTree.vue b/src/pages/Zone/Card/ZoneLocationsTree.vue index e520398b2..bf12a8298 100644 --- a/src/pages/Zone/Card/ZoneLocationsTree.vue +++ b/src/pages/Zone/Card/ZoneLocationsTree.vue @@ -99,14 +99,13 @@ watch(storeData, async (val) => { nodes.value[0].children = [...val]; const fetchedNodeKeys = val.flatMap(getNodeIds); state.set('Tree', [...fetchedNodeKeys]); - const tree = state.get('Tree'); - for (let n of tree) { + for (let n of state.get('Tree')) { await fetchNodeLeaves(n); } expanded.value = [null, 1, ...fetchedNodeKeys]; }); -onMounted(async (n) => { +onMounted(async () => { const tree = [...state.get('Tree'), 1]; const lastStateTree = state.get('TreeState'); if (tree) {