Skip to content

Commit

Permalink
fix: fix openrank display (#929)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyantong2000 authored Nov 18, 2024
1 parent 2c86dc0 commit 2bd3359
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ const getDeveloperName = (target: HTMLElement): string | null => {
};

const renderTo = (container: HTMLElement, developerName: string, openrank: string) => {
const parentElement = container.parentNode?.parentElement?.parentElement;
const hovercardUrl = parentElement?.getAttribute('data-hovercard-target-url');
if (!hovercardUrl || !hovercardUrl.startsWith('/users')) {
return;
}
const openRankContainer = document.createElement('div');
container.appendChild(openRankContainer);
createRoot(openRankContainer).render(<View developerName={developerName} openrank={openrank} />);
Expand Down

0 comments on commit 2bd3359

Please sign in to comment.