Skip to content

Commit e193f10

Browse files
committed
Fix reactions on code comments (go-gitea#13390)
Co-authored-by: Lunny Xiao <[email protected]> (cherry picked from commit 06268dc)
1 parent 02259a0 commit e193f10

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

models/issue_comment.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,10 @@ func fetchCodeCommentsByReview(e Engine, issue *Issue, currentUser *User, review
11241124
return nil, err
11251125
}
11261126

1127+
if err := comment.LoadReactions(issue.Repo); err != nil {
1128+
return nil, err
1129+
}
1130+
11271131
if re, ok := reviews[comment.ReviewID]; ok && re != nil {
11281132
// If the review is pending only the author can see the comments (except the review is set)
11291133
if review.ID == 0 {

templates/repo/diff/comments.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</div>
3131
{{end}}
3232
{{end}}
33-
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) }}
33+
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $.root "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) }}
3434
{{template "repo/issue/view_content/context_menu" Dict "ctx" $.root "item" . "delete" true "diff" true "IsCommentPoster" (and $.root.IsSigned (eq $.root.SignedUserID .PosterID))}}
3535
</div>
3636
</div>
@@ -48,7 +48,7 @@
4848
{{$reactions := .Reactions.GroupByType}}
4949
{{if $reactions}}
5050
<div class="ui attached segment reactions">
51-
{{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) "Reactions" $reactions}}
51+
{{template "repo/issue/view_content/reactions" Dict "ctx" $.root "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) "Reactions" $reactions}}
5252
</div>
5353
{{end}}
5454
</div>

0 commit comments

Comments
 (0)