Skip to content

Commit d18dd77

Browse files
authored
The "Refresh Pull Request Comments" command does not work. (#8473)
Fixes #8445
1 parent ef521e8 commit d18dd77

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

src/github/pullRequestModel.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,10 @@ export class PullRequestModel extends IssueModel<PullRequest> implements IPullRe
192192
this._reviewThreadsCache = undefined;
193193
}
194194

195-
public async initializeReviewThreadCache(): Promise<void> {
196-
await this.getReviewThreads();
195+
public async initializeReviewThreadCache(): Promise<IReviewThread[]> {
196+
const threads = await this.getReviewThreads();
197197
this._reviewThreadsCacheInitialized = true;
198+
return threads;
198199
}
199200

200201
public get reviewThreadsCache(): IReviewThread[] {
@@ -1442,12 +1443,9 @@ export class PullRequestModel extends IssueModel<PullRequest> implements IPullRe
14421443
}
14431444

14441445
async initializeReviewThreadCacheAndReviewComments(): Promise<void> {
1445-
const { remote } = await this.githubRepository.ensure();
1446-
const raw = await this.getRawReviewComments();
1447-
1448-
this.setReviewThreadCacheFromRaw(raw);
1446+
const threads = await this.initializeReviewThreadCache();
14491447

1450-
this.comments = raw.map(node => node.comments.nodes.map(comment => parseGraphQLComment(comment, node.isResolved, node.isOutdated, this.githubRepository), remote))
1448+
this.comments = threads.map(node => node.comments)
14511449
.reduce((prev, curr) => prev.concat(curr), [])
14521450
.sort((a: IComment, b: IComment) => {
14531451
return a.createdAt > b.createdAt ? 1 : -1;

0 commit comments

Comments
 (0)