Skip to content

Commit

Permalink
fix(tree-base): if parent exists in cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Scrum committed Nov 5, 2020
1 parent 685d3c7 commit cf7a5bc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/tree-base/src/js/tree-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,6 @@
parentsCache.hasOwnProperty(row.uid)
) {
parents.push(parentsCache[row.uid]);
return
}

// aggregate if this is a leaf node
Expand All @@ -1134,13 +1133,15 @@
}

// add this node to the tree
service.addOrUseNode(grid, row, parents, aggregations);
if (!parentsCache.hasOwnProperty(row.uid)) {
service.addOrUseNode(grid, row, parents, aggregations);
}

if ( typeof(row.treeLevel) !== 'undefined' && row.treeLevel !== null && row.treeLevel >= 0 ) {
if (!parentsCache.hasOwnProperty(row.uid)) {
parentsCache[row.uid] = row;
parents.push(row);
}
parents.push(row);
currentLevel++;
currentState = service.setCurrentState(parents);
}
Expand Down

0 comments on commit cf7a5bc

Please sign in to comment.