Skip to content

Commit

Permalink
Fix for commenting ranges not showing (#3308)
Browse files Browse the repository at this point in the history
Fixes #3306
  • Loading branch information
alexr00 authored Feb 10, 2022
1 parent 362d450 commit f8fbe07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/view/reviewManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,12 +581,12 @@ export class ReviewManager {
if (this._folderRepoManager.activePullRequest?.reviewThreadsCacheReady && this._reviewModel.hasLocalFileChanges) {
await this.doRegisterCommentController();
} else {
const changeThreadsDisposable: vscode.Disposable | undefined =
this._folderRepoManager.activePullRequest?.onDidChangeReviewThreads(async () => {
if (changeThreadsDisposable) {
changeThreadsDisposable.dispose();
}
const changedLocalFilesChangesDisposable: vscode.Disposable | undefined =
this._reviewModel.onDidChangeLocalFileChanges(async () => {
if (this._folderRepoManager.activePullRequest?.reviewThreadsCache && this._reviewModel.hasLocalFileChanges) {
if (changedLocalFilesChangesDisposable) {
changedLocalFilesChangesDisposable.dispose();
}
await this.doRegisterCommentController();
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/view/reviewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class ReviewModel {
constructor() { }

get hasLocalFileChanges() {
return !!this._localFileChanges;
return this._localFileChanges && (this._localFileChanges.length > 0);
}

get localFileChanges(): GitFileChangeNode[] {
Expand Down

0 comments on commit f8fbe07

Please sign in to comment.