diff --git a/newegg-purchaser.js b/newegg-purchaser.js index f4fc25a..5f0464e 100755 --- a/newegg-purchaser.js +++ b/newegg-purchaser.js @@ -27,6 +27,7 @@ async function run() { const page = await browser.newPage(), maxVariance = 8, + refreshTries = Number(config.refresh_tries), startTime = Number(config.start_time.replace(/:.*/, "")) + Number(config.start_time.replace(/^[^:]*:/, "")) / 60, endTime = Number(config.end_time.replace(/:.*/, "")) + Number(config.end_time.replace(/^[^:]*:/, "")) / 60; @@ -116,8 +117,8 @@ async function run() { } break; - } else if (config.refresh_tries !== 0 && currentTry > config.refresh_tries) { - log(`Fail: Maximum number of refresh tries reached (${config.refresh_tries})`); + } else if (refreshTries !== 0 && currentTry > refreshTries) { + log(`Fail: Maximum number of refresh tries reached (${refreshTries})`); success = false; break; } else {