Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit ea273a9

Browse files
committed
Fix navigation to outdated comments
Navigate to file at commit where comment was orignally added.
1 parent 8e90ce9 commit ea273a9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/GitHub.App/ViewModels/GitHubPane/PullRequestReviewCommentViewModel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ async Task DoOpen()
5252
{
5353
if (thread == null)
5454
{
55-
var file = await session.GetFile(RelativePath, model.Thread.CommitSha);
55+
var sha = model.Thread.IsOutdated ? model.Thread.OriginalCommitSha : model.Thread.CommitSha;
56+
var file = await session.GetFile(RelativePath, sha);
5657
thread = file.InlineCommentThreads.FirstOrDefault(t => t.Comments.Any(c => c.Comment.Id == model.Id));
5758
}
5859

src/GitHub.InlineReviews/Services/PullRequestSessionService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public IReadOnlyList<IInlineCommentThreadModel> BuildCommentThreads(
116116
relativePath = relativePath.Replace("\\", "/");
117117

118118
var threadsByPosition = pullRequest.Threads
119-
.Where(x => x.Path == relativePath && !x.IsOutdated)
119+
.Where(x => x.Path == relativePath)
120120
.OrderBy(x => x.Id)
121121
.GroupBy(x => Tuple.Create(x.OriginalCommitSha, x.OriginalPosition));
122122
var threads = new List<IInlineCommentThreadModel>();

0 commit comments

Comments
 (0)