From d05844fa5490c55a65a92c105081476a1998f8fc Mon Sep 17 00:00:00 2001 From: bossgeekgo Date: Sat, 10 Feb 2024 09:30:29 +0800 Subject: [PATCH] prevent `SyntaxError: Identifier 'targetEl' has already been declared` --- main/index.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/index.mjs b/main/index.mjs index 464a6e8..1dcfa0f 100644 --- a/main/index.mjs +++ b/main/index.mjs @@ -146,7 +146,7 @@ async function mainLoop () { if (targetJobIndex > 0) { // scroll that target element into view await page.evaluate(` - const targetEl = document.querySelector("ul.rec-job-list").children[${targetJobIndex}] + targetEl = document.querySelector("ul.rec-job-list").children[${targetJobIndex}] targetEl.scrollIntoView({ behavior: 'smooth', block: ${Math.random() > 0.5 ? '\'center\'' : '\'end\''}