7525-devToTest #419

Merged
alexm merged 177 commits from 7525-devToTest into test 2024-06-04 08:06:27 +00:00
1 changed files with 20 additions and 12 deletions
Showing only changes of commit 1347e4ec40 - Show all commits

View File

@ -94,19 +94,27 @@ function getNodeIds(node) {
return ids;
}
watch(storeData, async (val) => {
// Se triggerea cuando se actualiza el store.data, el cual es el resultado del fetch de la searchbar
nodes.value[0].children = [...val];
const fetchedNodeKeys = val.flatMap(getNodeIds);
state.set('Tree', [...fetchedNodeKeys]);
const tree = state.get('Tree');
for (let n of tree) {
await fetchNodeLeaves(n);
}
expanded.value = [null, 1, ...fetchedNodeKeys];
});
watch(
storeData,
async (val) => {
// Se triggerea cuando se actualiza el store.data, el cual es el resultado del fetch de la searchbar
nodes.value[0].children = [...val];
const fetchedNodeKeys = val.flatMap(getNodeIds);
state.set('Tree', [...fetchedNodeKeys]);
const tree = state.get('Tree');
for (let n of tree) {
await fetchNodeLeaves(n);
}
expanded.value = [null, 1, ...fetchedNodeKeys];
},
{ immediate: true }
);
onMounted(async (n) => {
onMounted(async () => {
if (store.userParams?.search) {
await arrayData.fetch({ append: false });
return;
}
const tree = [...state.get('Tree'), 1];
const lastStateTree = state.get('TreeState');
if (tree) {