Merge pull request #14 from Kareadita/feature/directories

Directory Picker
This commit is contained in:
Joseph Milazzo 2020-12-24 11:18:56 -06:00 committed by GitHub
commit c84c56864e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -59,18 +59,23 @@ export class DirectoryPickerComponent implements OnInit {
selectNode(folderName: string) {
this.currentRoot = folderName;
this.routeStack.push(folderName);
this.loadChildren(folderName);
const fullPath = this.routeStack.items.join('\\').replace('\\\\', '\\');
this.loadChildren(fullPath);
}
goBack() {
this.routeStack.pop();
this.currentRoot = this.routeStack.peek();
this.loadChildren(this.currentRoot);
const fullPath = this.routeStack.items.join('\\').replace('\\\\', '\\');
this.loadChildren(fullPath);
}
loadChildren(path: string) {
this.libraryService.listDirectories(path).subscribe(folders => {
this.folders = folders;
}, err => {
// If there was an error, pop off last directory added to stack
this.routeStack.pop();
});
}