From 1d1f95d1abaa862bc07b6849ca611f78a41184b7 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 18 May 2023 16:40:41 +0200 Subject: [PATCH] eg: move screenshot up before status checks since blank page after purchaseURL --- epic-games.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epic-games.js b/epic-games.js index 78cca86..1db4509 100644 --- a/epic-games.js +++ b/epic-games.js @@ -141,6 +141,9 @@ try { const notify_game = { title, url, status: 'failed' }; notify_games.push(notify_game); // status is updated below + const p = path.resolve(cfg.dir.screenshots, 'epic-games', `${game_id}.png`); + if (!existsSync(p)) await page.screenshot({ path: p, fullPage: false }); // fullPage is quite long... + if (btnText.toLowerCase() == 'in library') { console.log(' Already in library! Nothing to claim.'); notify_game.status = 'existed'; @@ -238,9 +241,6 @@ try { db.data[user][game_id].status = 'failed'; } notify_game.status = db.data[user][game_id].status; // claimed or failed - - const p = path.resolve(cfg.dir.screenshots, 'epic-games', `${game_id}.png`); - if (!existsSync(p)) await page.screenshot({ path: p, fullPage: false }); // fullPage is quite long... } } } catch (error) {