aliexpress: Promise.race mutually exclusive alternatives instead of Promise.any
This commit is contained in:
parent
bf6bad64fa
commit
ea96ffec19
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue