mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix: guard setExpand
This commit is contained in:
parent
0c0ee18795
commit
00ea07b181
1 changed files with 4 additions and 1 deletions
|
|
@ -254,7 +254,10 @@ class FlattenLayer extends CompressLayer {
|
|||
|
||||
barelySetExpand = (node: TreeNode, expand: boolean) => {
|
||||
if (expand) {
|
||||
this.expandedNodes.add(node.path)
|
||||
if (node.type === 'tree') {
|
||||
// expanding non-tree node could cause unexpected UX
|
||||
this.expandedNodes.add(node.path)
|
||||
}
|
||||
} else {
|
||||
this.expandedNodes.delete(node.path)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue