Skip to content

Commit

Permalink
Update comments when refreshing changes
Browse files Browse the repository at this point in the history
and show progress
Fixes #6252
  • Loading branch information
alexr00 committed Oct 2, 2024
1 parent 1d55021 commit a3f8a5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1207,9 +1207,11 @@ ${contents}
context.subscriptions.push(
vscode.commands.registerCommand('pr.refreshChanges', _ => {
reviewsManager.reviewManagers.forEach(reviewManager => {
reviewManager.updateComments();
PullRequestOverviewPanel.refresh();
reviewManager.changesInPrDataProvider.refresh();
vscode.window.withProgress({ location: { viewId: 'prStatus:github' } }, async () => {
await reviewManager.updateComments();
PullRequestOverviewPanel.refresh();
reviewManager.changesInPrDataProvider.refresh();
});
});
}),
);
Expand Down
6 changes: 4 additions & 2 deletions src/github/activityBarViewProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,10 @@ export class PullRequestViewProvider extends WebviewViewBase implements vscode.W
}

public async refresh(): Promise<void> {
await this._item.initializeReviewThreadCache();
await this.updatePullRequest(this._item);
return vscode.window.withProgress({ location: { viewId: 'github:activePullRequest' } }, async () => {
await this._item.initializeReviewThreadCache();
await this.updatePullRequest(this._item);
});
}

private getCurrentUserReviewState(reviewers: ReviewState[], currentUser: IAccount): string | undefined {
Expand Down

0 comments on commit a3f8a5c

Please sign in to comment.