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

Function handler

source/features/update-pr-from-base-branch.tsx:56–79  ·  view source on GitHub ↗
({delegateTarget: button}: DelegateEvent<MouseEvent, HTMLButtonElement>)

Source from the content-addressed store, hash-verified

54}
55
56async 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
81const feature = getIdentifiers(import.meta.url);
82

Callers

nothing calls this directly

Calls 5

showToastFunction · 0.85
getBranchesFunction · 0.85
getPrInfoFunction · 0.85
mergeBranchesFunction · 0.85
removeMethod · 0.80

Tested by

no test coverage detected