(parent: HTMLDetailsElement)
| 21 | }; |
| 22 | |
| 23 | async function add(parent: HTMLDetailsElement): Promise<void | false> { |
| 24 | const prsByBranch = await pullRequestsAssociatedWithBranch.get(); |
| 25 | const currentBranch = getCurrentGitRef()!; |
| 26 | const prInfo = prsByBranch[currentBranch]; |
| 27 | if (!prInfo) { |
| 28 | return; |
| 29 | } |
| 30 | |
| 31 | const StateIcon = stateIcon[prInfo.state]; |
| 32 | |
| 33 | addAfterBranchSelector( |
| 34 | parent, |
| 35 | <a |
| 36 | data-issue-and-pr-hovercards-enabled |
| 37 | href={prInfo.url} |
| 38 | className="btn flex-self-center rgh-list-prs-for-branch" |
| 39 | data-hovercard-type="pull_request" |
| 40 | data-hovercard-url={prInfo.url + '/hovercard'} |
| 41 | > |
| 42 | <StateIcon className={stateColorMap[prInfo.state]} /> |
| 43 | <span> #{prInfo.number}</span> |
| 44 | </a>, |
| 45 | ); |
| 46 | } |
| 47 | |
| 48 | async function init(signal: AbortSignal): Promise<false | void> { |
| 49 | observe(branchSelectorParent, add, {signal}); |
nothing calls this directly
no test coverage detected