From 093a5e22ae595992bc6a72bf73c98167603d02d8 Mon Sep 17 00:00:00 2001 From: PAN Lei Date: Thu, 10 Nov 2022 12:01:20 +0100 Subject: [PATCH] concat 3 times of contact list --- src/appointment.js | 5 +---- src/workers/GeoCaptchaSolver.js | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/appointment.js b/src/appointment.js index 6913e84..078ac6b 100644 --- a/src/appointment.js +++ b/src/appointment.js @@ -21,9 +21,6 @@ async function filterAlreadyBookedContacts(contactList) { return contactsToBook; } - -// Connect to the device. - async function needToBook(contact, mongoManager) { console.log("check contact with email " + contact.mail) let alreadyBooked = await mongoManager.getAllSuccessfulItemsForDay(collectionName); @@ -78,7 +75,7 @@ async function startBook(contactPojo, device, selectedStore, audioAnalyse, alert } async function startWithList(contacts, device, selectedStore, audioAnalyse, alertBeep) { - let duplicatedList = [].concat(contacts).concat(contacts) + let duplicatedList = [].concat(contacts).concat(contacts).concat(contacts) await duplicatedList.reduce(async (promise, contactPojo) => { // This line will wait for the last async function to finish. // The first iteration uses an already resolved Promise diff --git a/src/workers/GeoCaptchaSolver.js b/src/workers/GeoCaptchaSolver.js index 6985965..498ccd3 100644 --- a/src/workers/GeoCaptchaSolver.js +++ b/src/workers/GeoCaptchaSolver.js @@ -78,7 +78,7 @@ class GeoCaptchaSolver { await delay(2000 + getRandomWaitTime()); } try { - if (number_list.isEmpty()) { + if (number_list.length === 0) { onResult(false) } else { onResult(true)