Skip to content

Commit

Permalink
Resolve bug in Conversation Page (#8343)
Browse files Browse the repository at this point in the history
  • Loading branch information
chidozieononiwu authored May 29, 2024
1 parent a57c073 commit 0ee6250
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Conversation.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -102,22 +102,25 @@
{
int indexA = Model.SampleLines.Count() - Math.Abs(revision.Key.sampleRevisionNumber - skipped);
int indexB = int.Parse(thread.Comments.First().ElementId.Split("-").Last()) - 1;
@if (thread.Comments.Any())
{
var elementId = thread.LineId;
if (Model.SampleLines.Count() > indexA && Model.SampleLines.ElementAt(indexA).Count() > indexB)
{
@if (thread.Comments.Any())
{
var elementId = thread.LineId;

<tr class="code-line">
<td class="code p-2" style="word-break: break-all;">
<a class="comment-url" asp-page="Samples"
asp-route-id=@Model.Review.Id
asp-route-revisionId=@thread.Comments.First().ElementId.Split("-").First()
asp-fragment=@Uri.EscapeDataString(elementId)>
@Html.Raw(Model.SampleLines.ElementAt(indexA).ElementAt(indexB))
</a>
</td>
</tr>
}
<partial name="_CommentThreadPartial" model="@thread" />
<tr class="code-line">
<td class="code p-2" style="word-break: break-all;">
<a class="comment-url" asp-page="Samples"
asp-route-id=@Model.Review.Id
asp-route-revisionId=@thread.Comments.First().ElementId.Split("-").First()
asp-fragment=@Uri.EscapeDataString(elementId)>
@Html.Raw(Model.SampleLines.ElementAt(indexA).ElementAt(indexB))
</a>
</td>
</tr>
}
<partial name="_CommentThreadPartial" model="@thread" />
}
}
</table>
</div>
Expand Down

0 comments on commit 0ee6250

Please sign in to comment.