Skip to content

Commit ef14c4f

Browse files
committed
reduce requests
1 parent 3f82620 commit ef14c4f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/gitment.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,10 @@ class Gitment {
207207
if (!this.accessToken) return Promise.resolve([])
208208

209209
return this.getIssue()
210-
.then(issue => http.get(issue.reactions.url, {}, ''))
210+
.then((issue) => {
211+
if (!issue.reactions.heart) return []
212+
return http.get(issue.reactions.url, { content: 'heart' }, '')
213+
})
211214
.then((reactions) => {
212215
this.state.reactions = reactions
213216
return reactions

0 commit comments

Comments
 (0)