mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
Merge pull request #114 from wayjam/fix/expand-path
fix: invalid expand path
This commit is contained in:
commit
75b0fd00a6
1 changed files with 7 additions and 10 deletions
|
|
@ -287,18 +287,15 @@ class FlattenLayer extends CompressLayer {
|
|||
const rootNode = this.compressedRoot
|
||||
if (rootNode) {
|
||||
await traverse(
|
||||
[rootNode],
|
||||
rootNode.contents,
|
||||
async node => {
|
||||
const overflowChar = node.path[path.length + 1]
|
||||
const overflowChar = path[node.path.length]
|
||||
const match = path.startsWith(node.path) && (overflowChar === '/' || !overflowChar)
|
||||
if (node.path) {
|
||||
// rootNode.path === ''
|
||||
if (match) {
|
||||
if (node.path === path) {
|
||||
// do not wait for expansion for the exact node as that will block "jumping from search"
|
||||
this.$setExpand(node, true)
|
||||
} else await this.$setExpand(node, true)
|
||||
}
|
||||
if (match) {
|
||||
if (node.path === path) {
|
||||
// do not wait for expansion for the exact node as that will block "jumping from search"
|
||||
this.$setExpand(node, true)
|
||||
} else await this.$setExpand(node, true)
|
||||
}
|
||||
return match
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue