Skip to content

Commit df2b868

Browse files
committed
Show viewerHasReacted info in reaction
1 parent aec5cdc commit df2b868

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

graphql/get-pull-request.graphql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ query($repo_owner:String!, $repo_name:String!, $pr_id:Int!) {
2222
reactionGroups {
2323
content
2424
reactors { totalCount }
25+
viewerHasReacted
2526
}
2627
author {
2728
login
@@ -98,6 +99,7 @@ query($repo_owner:String!, $repo_name:String!, $pr_id:Int!) {
9899
reactionGroups {
99100
content
100101
reactors { totalCount }
102+
viewerHasReacted
101103
}
102104
}
103105
}
@@ -178,6 +180,7 @@ query($repo_owner:String!, $repo_name:String!, $pr_id:Int!) {
178180
reactionGroups {
179181
content
180182
reactors { totalCount }
183+
viewerHasReacted
181184
}
182185
}
183186
... on PullRequestReview {
@@ -194,6 +197,7 @@ query($repo_owner:String!, $repo_name:String!, $pr_id:Int!) {
194197
reactionGroups {
195198
content
196199
reactors { totalCount }
200+
viewerHasReacted
197201
}
198202

199203
comments(first: 100) {

pr-review-render.el

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,13 @@ INDENT is an optional number of extra spaces at the start of the line."
175175
(when (and (> .reactors.totalCount 0) .content)
176176
(when s
177177
(setq s (concat s " ")))
178-
(setq s (concat s (format "%s*%d"
179-
(alist-get .content pr-review-reaction-emojis .content nil 'equal)
180-
.reactors.totalCount))))))
178+
(setq s (concat
179+
s
180+
(format "%s*%d"
181+
(alist-get .content pr-review-reaction-emojis .content nil 'equal)
182+
.reactors.totalCount)
183+
(when .viewerHasReacted
184+
"#"))))))
181185
(when s
182186
(when indent
183187
(insert (propertize " " 'display `(space :width (,(* indent pr-review--char-pixel-width))))))

0 commit comments

Comments
 (0)