Skip to content

Commit 0819bc3

Browse files
committed
Clean up
1 parent 7c43556 commit 0819bc3

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

src/github/pullRequestOverview.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -653,10 +653,8 @@ export class PullRequestOverviewPanel extends IssueOverviewPanel<PullRequestMode
653653

654654
private async setReadyForReviewAndMerge(message: IRequestMessage<{ mergeMethod: MergeMethod }>): Promise<void> {
655655
try {
656-
// Step 1: Mark as ready for review
657656
const readyResult = await this._item.setReadyForReview();
658657

659-
// Step 2: Approve the PR
660658
try {
661659
await this._item.approve(this._folderRepositoryManager.repository, '');
662660
} catch (e) {
@@ -665,7 +663,6 @@ export class PullRequestOverviewPanel extends IssueOverviewPanel<PullRequestMode
665663
return;
666664
}
667665

668-
// Step 3: Enable auto-merge
669666
try {
670667
await this._item.enableAutoMerge(message.args.mergeMethod);
671668
} catch (e) {
@@ -674,7 +671,6 @@ export class PullRequestOverviewPanel extends IssueOverviewPanel<PullRequestMode
674671
return;
675672
}
676673

677-
// Return the ready result to update the UI
678674
this._replyMessage(message, readyResult);
679675
} catch (e) {
680676
vscode.window.showErrorMessage(`Unable to mark pull request as ready for review. ${formatError(e)}`);

webviews/components/merge.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,12 @@ export const ReadyForReview = ({ isSimple, isCopilotOnMyBehalf, mergeMethod }: {
298298

299299
const markReadyAndMerge = useCallback(async () => {
300300
try {
301+
setBusy(true);
301302
setMergeBusy(true);
302303
const result = await readyForReviewAndMerge({ mergeMethod: mergeMethod });
303304
updatePR(result);
304305
} finally {
306+
setBusy(false);
305307
setMergeBusy(false);
306308
}
307309
}, [readyForReviewAndMerge, updatePR, mergeMethod]);
@@ -319,15 +321,15 @@ export const ReadyForReview = ({ isSimple, isCopilotOnMyBehalf, mergeMethod }: {
319321
{isCopilotOnMyBehalf && (
320322
<button
321323
className="icon-button"
322-
disabled={isBusy || isMergeBusy}
324+
disabled={isBusy}
323325
onClick={markReadyAndMerge}
324326
title="Mark as ready for review, approve, and enable auto-merge with default merge method"
325327
aria-label="Ready for Review, Approve, and Auto-Merge"
326328
>
327329
{isMergeBusy ? loadingIcon : checkAllIcon}
328330
</button>
329331
)}
330-
<button disabled={isBusy || isMergeBusy} onClick={markReadyForReview}>Ready for Review</button>
332+
<button disabled={isBusy} onClick={markReadyForReview}>Ready for Review</button>
331333
</div>
332334
</div>
333335
);

0 commit comments

Comments
 (0)