@@ -56,7 +56,7 @@ class Gitment {
56
56
labels : [ ] ,
57
57
theme : defaultTheme ,
58
58
oauth : { } ,
59
- perPage : 30 ,
59
+ perPage : 20 ,
60
60
maxCommentHeight : 250 ,
61
61
} , options )
62
62
@@ -172,6 +172,14 @@ class Gitment {
172
172
post ( body ) {
173
173
return this . getIssue ( )
174
174
. then ( issue => http . post ( issue . comments_url , { body } , '' ) )
175
+ . then ( data => {
176
+ this . state . meta . comments ++
177
+ const pageCount = Math . ceil ( this . state . meta . comments / this . perPage )
178
+ if ( this . state . currentPage === pageCount ) {
179
+ this . state . comments . push ( data )
180
+ }
181
+ return data
182
+ } )
175
183
}
176
184
177
185
loadMeta ( ) {
@@ -218,8 +226,8 @@ class Gitment {
218
226
219
227
return this . getIssue ( )
220
228
. then ( ( issue ) => {
221
- if ( ! issue . reactions . heart ) return [ ]
222
- return http . get ( issue . reactions . url , { content : 'heart' } , '' )
229
+ if ( ! issue . reactions . total_count ) return [ ]
230
+ return http . get ( issue . reactions . url , { } , '' )
223
231
} )
224
232
. then ( ( reactions ) => {
225
233
this . state . reactions = reactions
@@ -237,10 +245,10 @@ class Gitment {
237
245
const comentReactions = { }
238
246
239
247
return Promise . all ( comments . map ( ( comment ) => {
240
- if ( ! comment . reactions . heart ) return [ ]
248
+ if ( ! comment . reactions . total_count ) return [ ]
241
249
242
250
const { owner, repo } = this
243
- return http . get ( `/repos/${ owner } /${ repo } /issues/comments/${ comment . id } /reactions` , { content : 'heart' } )
251
+ return http . get ( `/repos/${ owner } /${ repo } /issues/comments/${ comment . id } /reactions` , { } )
244
252
} ) )
245
253
. then ( reactionsArray => {
246
254
comments . forEach ( ( comment , index ) => {
0 commit comments