Skip to content

Commit 06268dc

Browse files
CirnoTlunny
andauthored
Fix reactions on code comments (#13390)
Co-authored-by: Lunny Xiao <[email protected]>
1 parent 563165a commit 06268dc

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
@@ -1111,6 +1111,10 @@ func fetchCodeCommentsByReview(e Engine, issue *Issue, currentUser *User, review
11111111
return nil, err
11121112
}
11131113

1114+
if err := comment.LoadReactions(issue.Repo); err != nil {
1115+
return nil, err
1116+
}
1117+
11141118
if re, ok := reviews[comment.ReviewID]; ok && re != nil {
11151119
// If the review is pending only the author can see the comments (except the review is set)
11161120
if review.ID == 0 {

templates/repo/diff/comments.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
</div>
4747
{{end}}
4848
{{end}}
49-
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) }}
49+
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $.root "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) }}
5050
{{template "repo/issue/view_content/context_menu" Dict "ctx" $.root "item" . "delete" true "diff" true "IsCommentPoster" (and $.root.IsSigned (eq $.root.SignedUserID .PosterID))}}
5151
</div>
5252
</div>
@@ -64,7 +64,7 @@
6464
{{$reactions := .Reactions.GroupByType}}
6565
{{if $reactions}}
6666
<div class="ui attached segment reactions">
67-
{{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) "Reactions" $reactions}}
67+
{{template "repo/issue/view_content/reactions" Dict "ctx" $.root "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) "Reactions" $reactions}}
6868
</div>
6969
{{end}}
7070
</div>

0 commit comments

Comments
 (0)