MCPcopy
hub / github.com/refined-github/refined-github / quickApprove

Function quickApprove

source/features/quick-review.tsx:35–54  ·  view source on GitHub ↗
(event: DelegateEvent<MouseEvent>)

Source from the content-addressed store, hash-verified

33const isNewFilesChangedExperienceEnabled = (): boolean => $(prFilesChangedTabSelector).href.endsWith('changes');
34
35async function quickApprove(event: DelegateEvent<MouseEvent>): Promise<void> {
36 const approval = event.altKey ? '' : prompt('Approve instantly? You can add a custom message or leave empty');
37 if (approval === null) {
38 return;
39 }
40
41 const call = api.v3uncached(`pulls/${getConversationNumber()!}/reviews`, {
42 method: 'POST',
43 body: {event: 'APPROVE', body: approval},
44 });
45
46 await showToast(call, {
47 message: 'Approving…',
48 doneMessage: `${randomArrayItem(emojis)} Approved`,
49 });
50
51 // Update timeline and scroll to bottom so the new review appears in view
52 scrollIntoViewIfNeeded($('#partial-timeline'));
53 triggerConversationUpdate();
54}
55
56async function openReviewDialogWhenAvailable(): Promise<void> {
57 const signal = AbortSignal.timeout(10_000);

Callers

nothing calls this directly

Calls 5

getConversationNumberFunction · 0.85
showToastFunction · 0.85
randomArrayItemFunction · 0.85
scrollIntoViewIfNeededFunction · 0.85

Tested by

no test coverage detected