Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: missing stats element in bull-off #28

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion entrypoints/match.content/setPlayerInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export async function setPlayerInfo() {

const turnContainerEl = document.getElementById("ad-ext-turn");
const throws = [ ...turnContainerEl?.querySelectorAll(".ad-ext-turn-throw") as NodeListOf<HTMLElement> ].map(el => el.innerText);
const turnPoints = document.querySelector<HTMLElement>(".ad-ext-turn-points")?.innerText.trim();
const turnPoints = document.querySelector<HTMLElement>(".ad-ext-turn-points")?.innerText?.trim();

const matchStatus: IMatchStatus = await AutodartsToolsMatchStatus.getValue();

Expand Down
4 changes: 2 additions & 2 deletions utils/getElements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export const getMenu = () => document.querySelector("#root > div > div") as HTML

export const getWinnerPlayerCard = () => document.querySelector(".ad-ext-player-winner");

export const getDartsThrown = (playerCard: HTMLElement) => playerCard?.nextElementSibling?.querySelector(":scope > div > p")?.textContent?.split("|")[0].trim().split("#")[1] || "";
export const getStats = (playerCard: HTMLElement) => playerCard?.nextElementSibling?.querySelector(":scope > div > p")?.textContent?.split("|")[1].trim();
export const getDartsThrown = (playerCard: HTMLElement) => playerCard?.nextElementSibling?.querySelector(":scope > div > p")?.textContent?.split("|")?.[0]?.trim().split("#")?.[1] || "";
export const getStats = (playerCard: HTMLElement) => playerCard?.nextElementSibling?.querySelector(":scope > div > p")?.textContent?.split("|")?.[1]?.trim() || "";

export const getUndoBtn = () => [ ...document.getElementById("ad-ext-turn")?.nextElementSibling?.querySelectorAll("button") as NodeListOf<HTMLButtonElement> ].find(el => el.textContent === "Undo");
export const getNextBtn = () => [ ...document.getElementById("ad-ext-turn")?.nextElementSibling?.querySelectorAll("button") as NodeListOf<HTMLButtonElement> ].find(el => el.textContent === "Next");