diff --git a/src/web/InputWaiter.mjs b/src/web/InputWaiter.mjs index 3e8ba1f0..bdb6fd77 100644 --- a/src/web/InputWaiter.mjs +++ b/src/web/InputWaiter.mjs @@ -296,7 +296,8 @@ class InputWaiter { if (this.pendingFiles.length > 0) { log.debug("Loading file completed. Loading next file."); - const nextFile = this.pendingFiles.pop(); + const nextFile = this.pendingFiles[0]; + this.pendingFiles.splice(0, 1); currentWorker.inputNum = nextFile.inputNum; currentWorker.worker.postMessage({ file: nextFile.file,