From 9cc09238b2b7a3e21ed18bea54eae788da141d41 Mon Sep 17 00:00:00 2001 From: spiduler Date: Sat, 7 Nov 2020 21:22:05 +0900 Subject: [PATCH] sdfd --- src/component/CaptchaComp.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/component/CaptchaComp.js b/src/component/CaptchaComp.js index 9f67c39..dcc1b0b 100644 --- a/src/component/CaptchaComp.js +++ b/src/component/CaptchaComp.js @@ -103,15 +103,13 @@ class CaptchaComp { } resolveCaptcha(driver) { - if (this.api.working === false) { - return this.api.working ? new Promise(r => r(new Error('Resovling Catpcha'))) : this.requestResolve(driver) - .then(id => this.getAnswer(id)) - .then(res => { - setTimeout(() => { this.api.working = false }, 1000 * 5 * 2) - logger.info({ result: res.request }, 'Calling captchaCallback') - return driver.executeScript('captchaCallback("' + res.request + '")').then(() => this.sleep(1000 * 5)) - }) - } + return this.api.working ? new Promise(r => r(new Error('Resovling Catpcha'))) : this.requestResolve(driver) + .then(id => this.getAnswer(id)) + .then(res => { + setTimeout(() => { this.api.working = false }, 1000 * 5 * 2) + logger.info({ result: res.request }, 'Calling captchaCallback') + return driver.executeScript('captchaCallback("' + res.request + '")').then(() => this.sleep(1000 * 5)) + }) } }