From ae2df94f593ac17f786a4512cc3094ec2343b2ea Mon Sep 17 00:00:00 2001 From: zockol Date: Tue, 26 Sep 2023 20:48:03 +0200 Subject: [PATCH] restored few lines of original code --- prime-gaming.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/prime-gaming.js b/prime-gaming.js index de4efec..52b7123 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -329,7 +329,7 @@ try { url: "https://gaming.amazon.com" + (await card.locator('a').last().getAttribute("href")), })) ); - console.log(dlcs); + // console.log(dlcs); const dlc_unlinked = {}; for (const dlc of dlcs) { @@ -354,6 +354,9 @@ try { unlinked_store = await linkAccountButton.getAttribute("aria-label"); console.debug(` Not able to claim. ${unlinked_store}`); const match = unlinked_store.match(/Link (.*) account/); + if (match && match.length == 2) unlinked_store = match[1]; + dlc_unlinked[unlinked_store] ??= []; + dlc_unlinked[unlinked_store].push(title); } else { //TODO this needs to be tested //ran out of possible prime offers @@ -374,8 +377,7 @@ try { await page.click('button[data-type="InGameLoot"]'); } } - // TODO - // console.log("DLC: Unlinked accounts:", dlc_unlinked); + console.log("DLC: Unlinked accounts:", dlc_unlinked); } } catch (error) { process.exitCode ||= 1;