From a477bb332791a7190fc686a82b6f9f65812abbc8 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 16:47:46 +0000 Subject: [PATCH] Fix lint: guard browser globals and normalize indentation --- epic-games.js | 2 +- prime-gaming.js | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/epic-games.js b/epic-games.js index d7eb80d..941383f 100644 --- a/epic-games.js +++ b/epic-games.js @@ -50,7 +50,7 @@ await page.setViewportSize({ width: cfg.width, height: cfg.height }); // workaro // some debug info about the page (screen dimensions, user agent) if (cfg.debug) { - // eslint-disable-next-line no-undef + /* global window, navigator */ const debugInfo = await page.evaluate(() => { const { width, height, availWidth, availHeight } = window.screen; return { diff --git a/prime-gaming.js b/prime-gaming.js index 47d7c70..a09cbca 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -527,12 +527,12 @@ try { } else if (reason == 'code_not_found') { redeem_action = 'redeem (not found)'; console.error(' Code was not found!'); - } else { // unknown state; keep info log for later analysis - redeem_action = 'redeemed?'; - console.debug(` Response 1: ${r1t}`); - const r2 = page2.waitForResponse(r => r.request().method() == 'POST' && r.url().startsWith('https://redeem.gog.com/')); - await page2.click('[type="submit"]'); // click Redeem - const r2t = await (await r2).text(); + } else { // unknown state; keep info log for later analysis + redeem_action = 'redeemed?'; + console.debug(` Response 1: ${r1t}`); + const r2 = page2.waitForResponse(r => r.request().method() == 'POST' && r.url().startsWith('https://redeem.gog.com/')); + await page2.click('[type="submit"]'); // click Redeem + const r2t = await (await r2).text(); const reason2 = JSON.parse(r2t).reason; if (r2t == '{}') { redeem_action = 'redeemed'; @@ -609,8 +609,8 @@ try { } else { notify_game.status = `claimed on ${store}`; db.data[user][title].status = 'claimed'; - } - await page.screenshot({ path: screenshot('external', `${filenamify(title)}.png`), fullPage: true }); + } + await page.screenshot({ path: screenshot('external', `${filenamify(title)}.png`), fullPage: true }); } } await page.goto(URL_CLAIM, { waitUntil: 'domcontentloaded' });