From 34b7c47533e83404f532148b12e5d290e524edcf Mon Sep 17 00:00:00 2001 From: j433866 Date: Fri, 31 May 2019 15:37:20 +0100 Subject: [PATCH] Fix highlighting not working --- src/web/WorkerWaiter.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/web/WorkerWaiter.mjs b/src/web/WorkerWaiter.mjs index 91f01b5d..0839ac07 100644 --- a/src/web/WorkerWaiter.mjs +++ b/src/web/WorkerWaiter.mjs @@ -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",