pg: reverse games: oldest/bottom to newest/top

This commit is contained in:
Ralf Vogler 2024-06-23 19:16:01 +02:00
parent f0f142733e
commit 30b1835bdb

View file

@ -107,6 +107,9 @@ try {
// can't use .all() since the list of elements via locator will change after click while we iterate over it // can't use .all() since the list of elements via locator will change after click while we iterate over it
const internal = await games.locator('.item-card__action:has([data-a-target="FGWPOffer"])').elementHandles(); const internal = await games.locator('.item-card__action:has([data-a-target="FGWPOffer"])').elementHandles();
const external = await games.locator('.item-card__action:has([data-a-target="ExternalOfferClaim"])').all(); const external = await games.locator('.item-card__action:has([data-a-target="ExternalOfferClaim"])').all();
// bottom to top: oldest to newest games
internal.reverse();
external.reverse();
console.log('Number of free unclaimed games (Prime Gaming):', internal.length); console.log('Number of free unclaimed games (Prime Gaming):', internal.length);
// claim games in internal store // claim games in internal store
for (const card of internal) { for (const card of internal) {