Allow loading from directories other than Data

Enables users to upload MO2 mod directory.

Also use updatePlugin instead of addPlugin to prevent duplicate plugins.
This commit is contained in:
2022-03-19 17:42:24 -04:00
parent 6d0eed2628
commit a9d1a5af54
3 changed files with 4 additions and 7 deletions

View File

@@ -30,10 +30,7 @@ export const DropZone: React.FC<Props> = ({ children, workerPool }) => {
}
if (next.value.kind === "file" && isPluginPath(next.value.name)) {
plugins.push(next.value);
} else if (
next.value.kind === "directory" &&
next.value.name === "Data"
) {
} else if (next.value.kind === "directory") {
plugins.push(...(await findPluginsInDirHandle(next.value)));
}
}