Skip to content

Commit

Permalink
gog: only unsubscribe from newsletter if a game was claimed?
Browse files Browse the repository at this point in the history
  • Loading branch information
vogler committed Feb 9, 2023
1 parent 11a28f0 commit d3e4c58
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gog.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,11 @@ try {
db.data[user][title].status ||= status;
notify_games.push({ title, url, status });

console.log("Unsubscribe from 'Promotions and hot deals' newsletter");
await page.goto('https://www.gog.com/en/account/settings/subscriptions');
await page.locator('li:has-text("Promotions and hot deals") label').uncheck();
if (status == 'claimed') { // TODO check if this is enough or if newsleter is enabled if 'existed'
console.log("Unsubscribe from 'Promotions and hot deals' newsletter");
await page.goto('https://www.gog.com/en/account/settings/subscriptions');
await page.locator('li:has-text("Promotions and hot deals") label').uncheck();
}
}
} catch (error) {
console.error(error); // .toString()?
Expand Down

0 comments on commit d3e4c58

Please sign in to comment.