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

Commit 6630f2d

Browse files
committed
Fix AvailableForComment calculation.
When showing a comment peek view on the LHS of the diff view, we need to look at `OldLineNumber` instead of `NewLineNumber` to calculate `AvailableForComment`. Fixes #2166
1 parent 306bd6b commit 6630f2d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/GitHub.InlineReviews/ViewModels/InlineCommentPeekViewModel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ async Task UpdateThread()
196196

197197
AvailableForComment =
198198
file.Diff.Any(chunk => chunk.Lines
199-
.Any(line => line.NewLineNumber - 1 == lineNumber));
199+
.Any(line => leftBuffer ?
200+
line.OldLineNumber -1 == lineNumber :
201+
line.NewLineNumber - 1 == lineNumber));
200202

201203
var thread = file.InlineCommentThreads?.FirstOrDefault(x =>
202204
x.LineNumber == lineNumber &&

0 commit comments

Comments
 (0)