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

Function addToHome

source/features/unreleased-commits.tsx:116–138  ·  view source on GitHub ↗
(branchSelectorElement: HTMLButtonElement)

Source from the content-addressed store, hash-verified

114}
115
116async function addToHome(branchSelectorElement: HTMLButtonElement): Promise<void> {
117 // React issues. Duplicates appear after a color scheme update
118 // https://github.com/refined-github/refined-github/issues/7536
119 if (elementExists('.rgh-unreleased-commits-wrapper')) {
120 return;
121 }
122
123 const {latestTag, aheadBy} = await repoPublishState.get();
124 const isAhead = aheadBy > 0;
125
126 if (!latestTag || !isAhead) {
127 return;
128 }
129
130 const linkGroup = await createLinkGroup(latestTag, aheadBy);
131 linkGroup.style.flexShrink = '0';
132
133 wrapAll(
134 <div className="d-flex gap-2 rgh-unreleased-commits-wrapper" />,
135 branchSelectorElement,
136 linkGroup,
137 );
138}
139
140async function addToReleases(releasesFilter: HTMLInputElement): Promise<void> {
141 const {latestTag, aheadBy} = await repoPublishState.get();

Callers

nothing calls this directly

Calls 3

createLinkGroupFunction · 0.85
wrapAllFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected