Skip to content

Commit

Permalink
hotfix for ecr error (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfficcadenti authored Jul 15, 2022
1 parent a2a59b7 commit c3a9043
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 858 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ async function closePopups(page) {

async function checkEcr(page) {
try {
const ecr = await getElementTextByXpath(page, "//div[@class='dec-options'][1]/div[@class='value'][2]/div", 100);
const ecr = await getElementTextByXpath(page, "//div[@class='dec-options'][1]/div[@class='value'][2]/div", 100).catch((e)=> { console.log(e.message); return 1; });;
if(ecr) {
console.log(chalk.bold.whiteBright.bgMagenta('Your current Energy Capture Rate is ' + ecr.split('.')[0] + "%"));
console.log(chalk.bold.whiteBright.bgMagenta('Your current Energy Capture Rate is ' + ecr?.split('.')[0] + "%"));
return parseFloat(ecr)
}
} catch (e) {
Expand Down
Loading

0 comments on commit c3a9043

Please sign in to comment.