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

Function init

source/features/closing-remarks.tsx:111–135  ·  view source on GitHub ↗
(signal: AbortSignal)

Source from the content-addressed store, hash-verified

109}
110
111async function init(signal: AbortSignal): Promise<void> {
112 const mergeCommit = $(`.TimelineItem.js-details-container.Details a[href^="/${getRepo()!.nameWithOwner}/commit/" i]`);
113 const {hash} = /commit\/(?<hash>[0-9a-f]{40})/.exec(mergeCommit.pathname)!.groups!;
114 const tagName = await firstTag.get(hash);
115
116 if (tagName) {
117 const tagUrl = buildRepoUrl('releases/tag', tagName);
118
119 // Add static box at the bottom
120 addTagToFooter(tagName, tagUrl, signal);
121
122 // PRs have a regular and a sticky header
123 observe('[class*="PullRequestHeaderSummary"] relative-time', addTagToHeader.bind(undefined, tagName, tagUrl), {
124 signal,
125 });
126 return;
127 }
128
129 void addReleaseBanner(
130 <>
131 No <ExplanationLink>stable version tags</ExplanationLink> for this PR.
132 </>,
133 signal,
134 );
135}
136
137void features.add(import.meta.url, {
138 // When arriving on an already-merged PR

Callers

nothing calls this directly

Calls 6

buildRepoUrlFunction · 0.85
addTagToFooterFunction · 0.85
observeFunction · 0.85
addReleaseBannerFunction · 0.85
waitForPrMergeFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected