Fix highlighting not working

This commit is contained in:
j433866 2019-05-31 15:37:20 +01:00
parent d6a80b4865
commit 34b7c47533
1 changed files with 4 additions and 1 deletions

View File

@ -663,7 +663,10 @@ class WorkerWaiter {
* @param {number} pos.end - The end offset.
*/
highlight(recipeConfig, direction, pos) {
const workerIdx = this.addChefWorker();
let workerIdx = this.getInactiveChefWorker(false);
if (workerIdx === -1) {
workerIdx = this.addChefWorker();
}
if (workerIdx === -1) return;
this.chefWorkers[workerIdx].worker.postMessage({
action: "highlight",