Skip to content

Commit

Permalink
normal commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Peng Kaifan committed Sep 7, 2020
1 parent 22e09bc commit fe45507
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
<ReviewComment v-for="item in comments.data.filter(i => !i.in_reply_to_id)" :key="item.id" :reviewComment="item"/>
</transition-group>

<HiddenItemLoading v-if="comments.pageInfo.next" style="padding-bottom:0px!important" :loading="comments.loading" :dataGetter="network_getReviewComments">
<!-- <HiddenItemLoading v-if="comments.pageInfo.next" style="padding-bottom:0px!important" :loading="comments.loading" :dataGetter="network_getReviewComments">
{{comments.totalCount - data.length}} {{comments.totalCount - data.length > 1 ? 'comments' : 'comment'}} remained.
</HiddenItemLoading>
</HiddenItemLoading> -->

</Container>
</template>
Expand Down Expand Up @@ -94,6 +94,7 @@
...mapState({
newSubmittedReviews: state => state.pullRequestDetail.newSubmittedReviews,
deletedReviewComments: state => state.pullRequestDetail.deletedReviewComments,
newCreatedReviewComments: state => state.pullRequestDetail.newCreatedReviewComments
}),
repo() {
return this.$route.params.repo
Expand Down Expand Up @@ -132,7 +133,7 @@
methods: {
network_getData() {
this.network_getReviewComments()
this.network_getReviewCommentsCount()
//this.network_getReviewCommentsCount()
},
async network_getReviewComments() {
try{
Expand Down Expand Up @@ -230,10 +231,27 @@
},
watch: {
deletedReviewComments: function(newOne, oldOne) {
if(newOne.some(i => {
let differ = []
newOne.forEach(i => {
if(!oldOne.some(i_ => i_.id == i.id)) {
differ.push(i)
}
})
if(differ.some(i => {
return this.comments.data.some(i_ => i_.id == i.id)
})) {
this.network_getReviewComments(true)
this.network_getReviewComments()
}
},
newCreatedReviewComments(newOne,oldOne) {
let differ = []
newOne.forEach(i => {
if(!oldOne.some(i_ => i_.id == i.id)) {
differ.push(i)
}
})
if(differ.some(i => i.pullRequestReview.id == this.review.node_id)) {
this.network_getReviewComments()
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ export const GRAPHQL_PULL_TIMELINE = `
comment {
databaseId
state
replyTo {
id
}
pullRequestReview {
id
}
}
}
}
Expand Down

0 comments on commit fe45507

Please sign in to comment.