Skip to content

Commit d3e4c58

Browse files
committed
gog: only unsubscribe from newsletter if a game was claimed?
1 parent 11a28f0 commit d3e4c58

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

gog.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,11 @@ try {
122122
db.data[user][title].status ||= status;
123123
notify_games.push({ title, url, status });
124124

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

0 commit comments

Comments
 (0)