소스 검색

Fixes parenting of folder nodes

main
Eric Amodio 5 년 전
부모
커밋
9718c98359
1개의 변경된 파일7개의 추가작업 그리고 5개의 파일을 삭제
  1. +7
    -5
      src/views/nodes/folderNode.ts

+ 7
- 5
src/views/nodes/folderNode.ts 파일 보기

@ -43,14 +43,17 @@ export class FolderNode extends ViewNode {
this.root.descendants,
this.relativePath === undefined
);
if (nesting !== ViewFilesLayout.List) {
if (nesting === ViewFilesLayout.List) {
this.root.descendants.forEach(n => (n.relativePath = this.root.relativePath));
children = this.root.descendants;
} else {
children = [];
for (const folder of this.root.children.values()) {
if (folder.value === undefined) {
children.push(
new FolderNode(
this.view,
this,
this.folderName ? this : this.parent!,
this.repoPath,
folder.name,
folder,
@ -61,12 +64,11 @@ export class FolderNode extends ViewNode {
continue;
}
// Make sure to set the parent
(folder.value as any).parent = this.folderName ? this : this.parent!;
folder.value.relativePath = this.root.relativePath;
children.push(folder.value);
}
} else {
this.root.descendants.forEach(n => (n.relativePath = this.root.relativePath));
children = this.root.descendants;
}
children.sort((a, b) => {

불러오는 중...
취소
저장