fix total item counting

This commit is contained in:
Tobias Koppers 2020-09-29 09:46:36 +02:00
parent 5b797bb55f
commit f1d23381aa
1 changed files with 6 additions and 3 deletions

View File

@ -1327,9 +1327,12 @@ const getTotalSize = children => {
const getTotalItems = children => { const getTotalItems = children => {
let count = 0; let count = 0;
for (const child of children) { for (const child of children) {
if (child.children) count += getTotalItems(child.children); if (!child.children && !child.filteredChildren) {
else if (child.filteredChildren) count += child.filteredChildren; count++;
else count++; } else {
if (child.children) count += getTotalItems(child.children);
if (child.filteredChildren) count += child.filteredChildren;
}
} }
return count; return count;
}; };