Skip to content

Commit

Permalink
fix(Bunpro): update dashboard selectors (PreMiD#7578)
Browse files Browse the repository at this point in the history
  • Loading branch information
theusaf authored Aug 15, 2023
1 parent 03d67c3 commit 5b6a800
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion websites/B/Bunpro/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"bunpro.jp",
"community.bunpro.jp"
],
"version": "2.0.7",
"version": "2.0.8",
"logo": "https://cdn.rcd.gg/PreMiD/websites/B/Bunpro/assets/logo.png",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/B/Bunpro/assets/thumbnail.png",
"color": "#5e6266",
Expand Down
15 changes: 4 additions & 11 deletions websites/B/Bunpro/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,11 @@ presence.on("UpdateData", () => {
break;
}
case "dashboard": {
const reviews = document.querySelector<HTMLDivElement>(
"article li:last-child a div:nth-child(2)"
).textContent;
presenceData.details = "Viewing dashboard";
presenceData.state = `${
document
.querySelector<HTMLAnchorElement>(".reviews-link")
.textContent.match(/\d+/)[0]
} review${
document
.querySelector<HTMLAnchorElement>(".reviews-link")
.textContent.match(/\d+/)[0] === "1"
? ""
: "s"
}`;
presenceData.state = `${reviews} review${reviews === "1" ? "" : "s"}`;
break;
}
case "grammar_points": {
Expand Down

0 comments on commit 5b6a800

Please sign in to comment.