Skip to content

Commit

Permalink
Merge pull request #1998 from candela97/fix-ingamelink-removing-priva…
Browse files Browse the repository at this point in the history
…te-svg

FInGameStoreLink: avoid removing private app indicator
  • Loading branch information
tfedor authored Aug 19, 2024
2 parents ff17c0a + cc1254e commit 097277b
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/js/Content/Features/Community/ProfileHome/FInGameStoreLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,19 @@ export default class FInGameStoreLink extends Feature<CProfileHome> {
return;
}

HTML.inner(node,
`<a href="//store.steampowered.com/app/${appid}" target="_blank">
<span data-tooltip-text="${L(__viewInStore)}">${node.textContent}</span>
</a>`);
// Find the text node and replace it to avoid removing the `.private_app_indicator` image
for (const n of node.childNodes) {
if (n.nodeType === Node.TEXT_NODE && n.textContent!.trim() !== "") {

HTML.beforeEnd(node,
`<a href="//store.steampowered.com/app/${appid}" target="_blank">
<span data-tooltip-text="${L(__viewInStore)}">${n.textContent}</span>
</a>`);

n.remove();

break;
}
}
}
}

0 comments on commit 097277b

Please sign in to comment.