@@ -66,7 +66,7 @@ const getQL = (vars, pagerDirection) => {
66
66
}
67
67
68
68
function getComments ( issue ) {
69
- const { owner, repo, perPage, pagerDirection } = this . options
69
+ const { owner, repo, perPage, pagerDirection, defaultAuthor } = this . options
70
70
const { cursor, comments } = this . state
71
71
return axiosGithub . post (
72
72
'/graphql' ,
@@ -86,20 +86,24 @@ function getComments (issue) {
86
86
}
87
87
) . then ( res => {
88
88
const data = res . data . data . repository . issue . comments
89
- const items = data . nodes . map ( node => ( {
90
- id : node . databaseId ,
91
- gId : node . id ,
92
- user : {
93
- avatar_url : node . author . avatarUrl ,
94
- login : node . author . login ,
95
- html_url : node . author . url
96
- } ,
97
- created_at : node . createdAt ,
98
- body_html : node . bodyHTML ,
99
- body : node . body ,
100
- html_url : `https://github.com/${ owner } /${ repo } /issues/${ issue . number } #issuecomment-${ node . databaseId } ` ,
101
- reactions : node . reactions
102
- } ) )
89
+ const items = data . nodes . map ( node => {
90
+ const author = node . author || defaultAuthor
91
+
92
+ return {
93
+ id : node . databaseId ,
94
+ gId : node . id ,
95
+ user : {
96
+ avatar_url : author . avatarUrl ,
97
+ login : author . login ,
98
+ html_url : author . url
99
+ } ,
100
+ created_at : node . createdAt ,
101
+ body_html : node . bodyHTML ,
102
+ body : node . body ,
103
+ html_url : `https://github.com/${ owner } /${ repo } /issues/${ issue . number } #issuecomment-${ node . databaseId } ` ,
104
+ reactions : node . reactions
105
+ }
106
+ } )
103
107
104
108
let cs
105
109
0 commit comments