diff --git a/src/workers/CommandorPage.js b/src/workers/CommandorPage.js index 3dbe5cc..79d1a67 100644 --- a/src/workers/CommandorPage.js +++ b/src/workers/CommandorPage.js @@ -68,6 +68,7 @@ class CommandorPage { this.isTerminated = false; this.audioAnalyse = audioAnalyse; this.alertBeep = alertBeep; + this.cguChecked = false; } @@ -208,11 +209,14 @@ class CommandorPage { async checkCGU(page) { try { if (!page.isClosed()) { - await page.locator(CGU_ID).focus() - await page.locator(CGU_ID).click() - await delay(getRandomWaitTime()) - await page.locator(PROCESSING_ID).focus() - await page.locator(PROCESSING_ID).click() + if (!this.cguChecked) { + await page.locator(CGU_ID).focus() + await page.locator(CGU_ID).click() + await delay(getRandomWaitTime()) + await page.locator(PROCESSING_ID).focus() + await page.locator(PROCESSING_ID).click() + this.cguChecked = true; + } } } catch (e) { log(e);