Skip to content

Commit

Permalink
Fix card exchange links not working
Browse files Browse the repository at this point in the history
  • Loading branch information
MxtOUT committed Jun 18, 2024
1 parent 5c5a5d9 commit 903bbb1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/js/Content/Features/Community/FCardExchangeLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,20 @@ export default class FCardExchangeLinks<T extends CBadges|CGameCard> extends Fea

public override apply(): void | Promise<void> {
document.addEventListener("as_pageUpdated", () => this.onPageUpdated());
this.onPageUpdated();
}

private onPageUpdated() {
const ceImg = ExtensionResources.getURL("img/ico/steamcardexchange.png");

for (const node of document.querySelectorAll<HTMLElement>(".badge_row:not(.es-has-ce-link)")) {
let appid: number|undefined;
let appid: number|null = null;
if (this.context.appid) {
appid = this.context.appid;
} else {
const overlay = node.querySelector<HTMLAnchorElement>("a.badge_row_overlay");
if (overlay) {
AppId.fromGameCardUrl(overlay.href);
appid = AppId.fromGameCardUrl(overlay.href);
}
}
if (!appid) { continue; }
Expand Down

0 comments on commit 903bbb1

Please sign in to comment.