fix: resolve remaining sonar findings
This commit is contained in:
parent
5e0c5263ca
commit
2bc8e958d2
3 changed files with 26 additions and 12 deletions
|
|
@ -433,13 +433,13 @@ try {
|
|||
}
|
||||
// Disabled CTA (e.g., needs linking or not available)
|
||||
if (await disabledCTA.count()) {
|
||||
if (store !== 'epic-games') {
|
||||
if (store === 'epic-games') {
|
||||
console.log(' CTA disabled for epic-games, will still try to link/claim.');
|
||||
} else {
|
||||
console.log(' CTA is disabled, skipping (likely needs linking/not available).');
|
||||
notify_game.status = 'disabled';
|
||||
db.data[user][title] ||= { title, time: datetime(), url, store, status: 'disabled' };
|
||||
continue;
|
||||
} else {
|
||||
console.log(' CTA disabled for epic-games, will still try to link/claim.');
|
||||
}
|
||||
}
|
||||
if (store == 'luna') {
|
||||
|
|
@ -664,13 +664,19 @@ try {
|
|||
await page.goto(url, { waitUntil: 'domcontentloaded' });
|
||||
// most games have a button 'Get in-game content'
|
||||
// epic-games: Fall Guys: Claim -> Continue -> Go to Epic Games (despite account linked and logged into epic-games) -> not tied to account but via some cookie?
|
||||
const claimAndContinue = async () => {
|
||||
await page.click('.tw-button:has-text("Claim")');
|
||||
try {
|
||||
await page.click('button:has-text("Continue")');
|
||||
} catch {
|
||||
// continue button not always present
|
||||
}
|
||||
};
|
||||
|
||||
const claimOptions = [
|
||||
page.click('.tw-button:has-text("Get in-game content")'),
|
||||
page.click('.tw-button:has-text("Claim your gift")'),
|
||||
(async () => {
|
||||
await page.click('.tw-button:has-text("Claim")');
|
||||
await page.click('button:has-text("Continue")').catch(() => {});
|
||||
})(),
|
||||
claimAndContinue(),
|
||||
];
|
||||
await Promise.any(claimOptions);
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue