Select file and plugin, add to new plugins state
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { createContext } from "react";
|
||||
|
||||
import {
|
||||
addPluginInOrder,
|
||||
addParsedPluginInOrder,
|
||||
decrementPending,
|
||||
PluginFile,
|
||||
} from "../slices/plugins";
|
||||
@@ -48,7 +48,7 @@ export class WorkerPool {
|
||||
resolve(worker);
|
||||
} else if (typeof data !== "string") {
|
||||
store.dispatch(decrementPending(1));
|
||||
store.dispatch(addPluginInOrder(data));
|
||||
store.dispatch(addParsedPluginInOrder(data));
|
||||
// Since web assembly memory cannot be shrunk, replace worker with a fresh one to avoid slow repeated
|
||||
// invocations on the same worker instance. Repeated invocations are so slow that the delay in creating a
|
||||
// new worker is worth it. In practice, there are usually more workers than tasks, so the delay does not slow
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { WorkerPool } from "./WorkerPool";
|
||||
import store from "./store";
|
||||
import { clearPlugins, setPending } from "../slices/plugins";
|
||||
import { clearParsedPlugins, setPending } from "../slices/plugins";
|
||||
|
||||
export const excludedPlugins = [
|
||||
"Skyrim.esm",
|
||||
@@ -28,7 +28,7 @@ export const parsePluginFiles = (pluginFiles: File[], workerPool: WorkerPool) =>
|
||||
alert("Found no plugins in the folder. Please select the Data folder underneath the Skyrim installation folder.");
|
||||
return;
|
||||
}
|
||||
store.dispatch(clearPlugins());
|
||||
store.dispatch(clearParsedPlugins());
|
||||
store.dispatch(setPending(pluginFiles.length));
|
||||
|
||||
pluginFiles.forEach(async (plugin) => {
|
||||
|
||||
Reference in New Issue
Block a user