({delegateTarget: button}: DelegateEvent<MouseEvent, HTMLButtonElement>)
| 54 | } |
| 55 | |
| 56 | async function handler({delegateTarget: button}: DelegateEvent<MouseEvent, HTMLButtonElement>): Promise<void> { |
| 57 | button.disabled = true; |
| 58 | const {method} = button.dataset as {method: UpdateMethod}; |
| 59 | |
| 60 | await showToast(async () => { |
| 61 | const {base} = getBranches(); |
| 62 | const {id, headRefOid} = await getPrInfo(base.relative); |
| 63 | const options = { |
| 64 | expectedHeadOid: headRefOid, |
| 65 | pullRequestId: id, |
| 66 | updateMethod: method, |
| 67 | }; |
| 68 | // eslint-disable-next-line @typescript-eslint/use-unknown-in-catch-callback-variable -- Just pass it along |
| 69 | const response = await mergeBranches(options).catch(error => error); |
| 70 | if (response instanceof Error) { |
| 71 | throw new Error(`Error updating the branch: ${response.message}`, {cause: response}); |
| 72 | } |
| 73 | }, { |
| 74 | message: 'Updating branch…', |
| 75 | doneMessage: 'Branch updated', |
| 76 | }); |
| 77 | |
| 78 | closestElement('.ButtonGroup', button).remove(); |
| 79 | } |
| 80 | |
| 81 | const feature = getIdentifiers(import.meta.url); |
| 82 |
nothing calls this directly
no test coverage detected