diff --git a/src/app/file-tree/file-tree.component.ts b/src/app/file-tree/file-tree.component.ts index c4a274d..167b489 100644 --- a/src/app/file-tree/file-tree.component.ts +++ b/src/app/file-tree/file-tree.component.ts @@ -149,7 +149,7 @@ export class FileTreeComponent implements OnInit, OnDestroy { const file = files[i]; if (file.webkitRelativePath?.includes('/')) { // Got a file in a folder, so put it into the appropriate folder in the tree - const splitFilePath = file.webkitRelativePath.split('/'); + const splitFilePath = file.webkitRelativePath.split('/').slice(1); let currentChildren: FileOrFolder[] | undefined = mappedFiles; for (let j = 0; j < splitFilePath.length - 1; j++) { const relativePath = splitFilePath[j];