MCPcopy Index your code
hub / github.com/refined-github/refined-github / addReleasesDropdownItem

Function addReleasesDropdownItem

source/features/releases-tab.tsx:83–105  ·  view source on GitHub ↗
(dropdownMenu: HTMLElement)

Source from the content-addressed store, hash-verified

81}
82
83async function addReleasesDropdownItem(dropdownMenu: HTMLElement): Promise<false | void> {
84 const [, type] = await getReleasesCount();
85
86 if (!type) {
87 // TODO: The feature was dropped
88 // Won't exist if `clean-repo-tabs` is disabled
89 $optional('.dropdown-divider', dropdownMenu)?.remove();
90 return false;
91 }
92
93 appendBefore(
94 dropdownMenu,
95 '.dropdown-divider', // Won't exist if `clean-repo-tabs` is disabled
96 createDropdownItem({
97 label: type,
98 href: buildRepoUrl(type.toLowerCase()),
99 icon: TagIcon,
100 'data-menu-item': 'rgh-releases-item',
101 }),
102 );
103
104 triggerRepoNavOverflow();
105}
106
107async function init(signal: AbortSignal): Promise<void> {
108 observe(repoUnderlineNavUl, addReleasesTab, {signal});

Callers

nothing calls this directly

Calls 6

getReleasesCountFunction · 0.85
appendBeforeFunction · 0.85
createDropdownItemFunction · 0.85
buildRepoUrlFunction · 0.85
triggerRepoNavOverflowFunction · 0.85
removeMethod · 0.80

Tested by

no test coverage detected