From ea96ffec19ad019743283a984fab5beae32c79ca Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Wed, 23 Jul 2025 00:21:11 +0200 Subject: [PATCH] aliexpress: Promise.race mutually exclusive alternatives instead of Promise.any --- aliexpress.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aliexpress.js b/aliexpress.js index eebbf48..7673f19 100644 --- a/aliexpress.js +++ b/aliexpress.js @@ -88,7 +88,7 @@ const coins = async () => { page.locator('.hideDoubleButton').click().catch(_ => {}); const collectBtn = page.locator('.signVersion-panel div:has-text("Collect")').first(); const moreBtn = page.locator('.signVersion-panel div:has-text("Earn more coins")').first(); - await Promise.any([ + await Promise.race([ collectBtn.click().then(_ => console.log('Collected coins for today!')), moreBtn.waitFor().then(_ => console.log('No more coins to collect today!')), ]); // sometimes did not make it click the collect button... moreBtn.isVisible() as alternative also didn't work