From 98dff72888259d9dd5f221d1fb6d01ed76e4e74d Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Sat, 28 Jan 2023 10:26:27 +0100 Subject: [PATCH] eg: notify: set status existed correctly, fixes #50 --- epic-games.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epic-games.js b/epic-games.js index 3077fd7..e1d8648 100644 --- a/epic-games.js +++ b/epic-games.js @@ -136,6 +136,7 @@ try { if (btnText.toLowerCase() == 'in library') { console.log(' Already in library! Nothing to claim.'); + notify_game.status = 'existed'; db.data[user][game_id].status ||= 'existed'; // does not overwrite claimed or failed if (db.data[user][game_id].status == 'failed') db.data[user][game_id].status = 'manual'; // was failed but now it's claimed } else { // GET @@ -186,11 +187,11 @@ try { await page.screenshot({ path: p, fullPage: true }); db.data[user][game_id].status = 'failed'; } + notify_game.status = db.data[user][game_id].status; // claimed or failed const p = path.resolve(dirs.screenshots, 'epic-games', `${game_id}.png`); if (!existsSync(p)) await page.screenshot({ path: p, fullPage: false }); // fullPage is quite long... } - notify_game.status = db.data[user][game_id].status; } } catch (error) { console.error(error); // .toString()?