From dbf36405df870894437cf015dce1640ca5b45eb0 Mon Sep 17 00:00:00 2001 From: Lei PAN Date: Fri, 4 Nov 2022 09:10:11 +0100 Subject: [PATCH] duplicate input contacts --- src/appointment.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/appointment.js b/src/appointment.js index b2f2313..6913e84 100644 --- a/src/appointment.js +++ b/src/appointment.js @@ -78,7 +78,8 @@ async function startBook(contactPojo, device, selectedStore, audioAnalyse, alert } async function startWithList(contacts, device, selectedStore, audioAnalyse, alertBeep) { - await contacts.reduce(async (promise, contactPojo) => { + let duplicatedList = [].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 // so, it will immediately continue.