Fix tsc error with FileSystemFileHandle

This commit is contained in:
2022-03-12 20:36:55 -05:00
parent 1fa2e3e660
commit 85630949c5
3 changed files with 16 additions and 2 deletions

View File

@@ -24,11 +24,11 @@ export const DropZone: React.FC<Props> = ({ children, workerPool }) => {
return false;
}
const entry = await item.getAsFileSystemHandle();
if (entry.kind === "file") {
if (entry?.kind === "file") {
const file = await (entry as FileSystemFileHandle).getFile();
dispatch(setPluginsTxtAndApplyLoadOrder(await file.text()));
return true;
} else if (entry.kind === "directory") {
} else if (entry?.kind === "directory") {
const plugins: { getFile: () => Promise<File> }[] = [];
const values = (
entry as FileSystemDirectoryHandle & { values: any }