7525-devToTest #419
|
@ -27,8 +27,11 @@ const nodes = ref([
|
||||||
const previousExpandedNodes = ref(new Set());
|
const previousExpandedNodes = ref(new Set());
|
||||||
|
|
||||||
const onNodeExpanded = async (nodeKeysArray) => {
|
const onNodeExpanded = async (nodeKeysArray) => {
|
||||||
const nodeKeysSet = new Set(nodeKeysArray);
|
let nodeKeysSet = new Set(nodeKeysArray);
|
||||||
const lastNodeKey = nodeKeysArray.at(-1);
|
const lastNodeKey = nodeKeysArray.at(-1);
|
||||||
|
|
||||||
|
if (!nodeKeysSet.has(null)) return;
|
||||||
|
|
||||||
const wasExpanded = !previousExpandedNodes.value.has(lastNodeKey);
|
const wasExpanded = !previousExpandedNodes.value.has(lastNodeKey);
|
||||||
if (wasExpanded) await fetchNodeLeaves(lastNodeKey);
|
if (wasExpanded) await fetchNodeLeaves(lastNodeKey);
|
||||||
else {
|
else {
|
||||||
|
@ -40,7 +43,6 @@ const onNodeExpanded = async (nodeKeysArray) => {
|
||||||
const allNodeIds = getNodeIds(node);
|
const allNodeIds = getNodeIds(node);
|
||||||
expanded.value = expanded.value.filter((id) => !allNodeIds.includes(id));
|
expanded.value = expanded.value.filter((id) => !allNodeIds.includes(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
previousExpandedNodes.value = nodeKeysSet;
|
previousExpandedNodes.value = nodeKeysSet;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue