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.