(event: DelegateEvent<MouseEvent>)
| 33 | const isNewFilesChangedExperienceEnabled = (): boolean => $(prFilesChangedTabSelector).href.endsWith('changes'); |
| 34 | |
| 35 | async 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 | |
| 56 | async function openReviewDialogWhenAvailable(): Promise<void> { |
| 57 | const signal = AbortSignal.timeout(10_000); |
nothing calls this directly
no test coverage detected