@@ -1420,11 +1420,12 @@ func ViewIssue(ctx *context.Context) {
1420
1420
}
1421
1421
1422
1422
var (
1423
- role issues_model.RoleDescriptor
1424
- ok bool
1425
- marked = make (map [int64 ]issues_model.RoleDescriptor )
1426
- participants = make ([]* user_model.User , 1 , 10 )
1427
- latestCloseCommentIndex int
1423
+ role issues_model.RoleDescriptor
1424
+ ok bool
1425
+ marked = make (map [int64 ]issues_model.RoleDescriptor )
1426
+ comment * issues_model.Comment
1427
+ participants = make ([]* user_model.User , 1 , 10 )
1428
+ latestCloseCommentID int64
1428
1429
)
1429
1430
if ctx .Repo .Repository .IsTimetrackerEnabled (ctx ) {
1430
1431
if ctx .IsSigned {
@@ -1468,7 +1469,7 @@ func ViewIssue(ctx *context.Context) {
1468
1469
1469
1470
// Render comments and and fetch participants.
1470
1471
participants [0 ] = issue .Poster
1471
- for i , comment : = range issue .Comments {
1472
+ for _ , comment = range issue .Comments {
1472
1473
comment .Issue = issue
1473
1474
1474
1475
if err := comment .LoadPoster (ctx ); err != nil {
@@ -1623,12 +1624,13 @@ func ViewIssue(ctx *context.Context) {
1623
1624
// drop error since times could be pruned from DB..
1624
1625
_ = comment .LoadTime ()
1625
1626
} else if comment .Type == issues_model .CommentTypeClose {
1626
- // record latest index of close comment.
1627
- latestCloseCommentIndex = i
1627
+ // record ID of latest closed comment.
1628
+ // if PR is closed, the comments after it won't be rendered.
1629
+ latestCloseCommentID = comment .ID
1628
1630
}
1629
1631
}
1630
1632
1631
- ctx .Data ["LatestCloseCommentIndex " ] = latestCloseCommentIndex
1633
+ ctx .Data ["LatestCloseCommentID " ] = latestCloseCommentID
1632
1634
1633
1635
// Combine multiple label assignments into a single comment
1634
1636
combineLabelComments (issue )
0 commit comments