Skip to content

Commit

Permalink
fix: odds format dropdown label change
Browse files Browse the repository at this point in the history
  • Loading branch information
Mg30 committed Jan 22, 2025
1 parent 74489cc commit 6916ee6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ const leaguesUrlsMap = {
};

const oddsFormatMap = {
"eu": "EU Odds",
"us": "US Odds",
"uk": "UK Odds",
"hk": "HK Odds",
"ma": "MA Odds",
"in": "IN Odds",
"eu": "Decimal Odds (1.50)",
"us": "Money Line Odds (-200)",
"uk": "Fractional Odds (1/2)",
"hk": "Hong Kong Odds (0.50)",
"ma": "Malay Odds (0.50)",
"in": "Indonesian Odds (-2.00)",
};


Expand Down
6 changes: 3 additions & 3 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ export async function setOddsFormat(page, format) {

try {
await page.waitForSelector('div.group > button.gap-2');
// Click the buttons to open the odds format dropdown menu and select the chosen format.
await page.$$eval('div.group > button.gap-2', els => els.map(el => el.click()));
await page.click('div.group > button.gap-2');
await page.waitForSelector('div.group > div.dropdown-content');
await page.$$eval('div.group > div.dropdown-content > ul.flex.flex-col.gap-3.pt-3.pb-3.pl-3 > li > a', (els, format) => {
await page.$$eval('div.group > div.dropdown-content > ul > li > a', (els, format) => {
els.find(el => el.textContent === format).click();
}, chosenFormat);

logger.info("Odds format changed");
} catch (error) {
console.log(error)
logger.warn("Odds have not been changed: May be because odds are already set in the required format");
}
}
Expand Down

0 comments on commit 6916ee6

Please sign in to comment.