Allow files in browser to be loaded, fix overflow on message list, show errors to user

This commit is contained in:
2024-08-17 15:01:10 +09:30
parent 3adbcfdc1c
commit dd6a4536c6
5 changed files with 47 additions and 19 deletions

View File

@@ -27,6 +27,7 @@ export interface FileOrFolder {
name: string;
children?: FileOrFolder[];
path?: string;
browserFile?: File;
}
interface FileNode {
@@ -159,15 +160,27 @@ export class FileTreeComponent implements OnInit, OnDestroy {
matchingChild = {
isDirectory: true,
name: relativePath,
path: file.webkitRelativePath,
children: [],
browserFile: file,
};
currentChildren?.push(matchingChild);
}
currentChildren = matchingChild.children;
}
currentChildren?.push({ isDirectory: false, name: file.name });
currentChildren?.push({
isDirectory: false,
name: file.name,
path: file.webkitRelativePath,
browserFile: file,
});
} else {
mappedFiles.push({ isDirectory: false, name: file.name });
mappedFiles.push({
isDirectory: false,
name: file.name,
path: file.webkitRelativePath,
browserFile: file,
});
}
}
this.recursiveSort(mappedFiles);