(branchSelectorElement: HTMLButtonElement)
| 114 | } |
| 115 | |
| 116 | async 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 | |
| 140 | async function addToReleases(releasesFilter: HTMLInputElement): Promise<void> { |
| 141 | const {latestTag, aheadBy} = await repoPublishState.get(); |
nothing calls this directly
no test coverage detected