Enable processing plugins as soon as there is one available worker
This commit is contained in:
@@ -30,7 +30,7 @@ const DataDirPicker: React.FC<Props> = () => {
|
||||
const onDataDirButtonClick = async (event: {
|
||||
target: { files: FileList | null };
|
||||
}) => {
|
||||
if (!workerPool) {
|
||||
if (!workerPool || workerPool.availableWorkers.length === 0) {
|
||||
return alert("Workers not loaded yet");
|
||||
}
|
||||
const files = event.target.files ?? [];
|
||||
|
||||
@@ -58,7 +58,7 @@ export const DropZone: React.FC<Props> = ({ children, workerPool }) => {
|
||||
const pluginFiles = await Promise.all(
|
||||
plugins.map(async (plugin) => plugin.getFile())
|
||||
);
|
||||
if (workerPool) {
|
||||
if (workerPool && workerPool.availableWorkers.length > 0) {
|
||||
parsePluginFiles(pluginFiles, workerPool);
|
||||
} else {
|
||||
alert("Workers not loaded yet");
|
||||
@@ -117,7 +117,7 @@ export const DropZone: React.FC<Props> = ({ children, workerPool }) => {
|
||||
)
|
||||
)
|
||||
);
|
||||
if (workerPool) {
|
||||
if (workerPool && workerPool.availableWorkers.length > 0) {
|
||||
parsePluginFiles(pluginFiles, workerPool);
|
||||
} else {
|
||||
alert("Workers not loaded yet");
|
||||
|
||||
Reference in New Issue
Block a user