diff options
Diffstat (limited to 'source/features/show-user-top-repositories.tsx')
-rw-r--r-- | source/features/show-user-top-repositories.tsx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/features/show-user-top-repositories.tsx b/source/features/show-user-top-repositories.tsx index 2e129802..34453c8b 100644 --- a/source/features/show-user-top-repositories.tsx +++ b/source/features/show-user-top-repositories.tsx @@ -4,18 +4,18 @@ import * as pageDetect from 'github-url-detection'; import features from '.'; -function buildUrl(): URL { +function init(): void { const url = new URL(location.pathname, location.href); - url.searchParams.set('tab', 'repositories'); - url.searchParams.set('sort', 'stargazers'); - return url; -} + // DO NOT add type: 'source' since forks could also have many stars + url.search = new URLSearchParams({ + tab: 'repositories', + sort: 'stargazers', + }).toString(); -function init(): void { // Showcase title select('.js-pinned-items-reorder-container .text-normal')!.firstChild!.after( ' / ', - <a href={String(buildUrl())}>Top repositories</a>, + <a href={url.href}>Top repositories</a>, ); } |