mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Tell vue-infinite-loader when complete or loaded
This commit is contained in:
parent
a6c169c2e0
commit
a10a735e35
@ -376,7 +376,7 @@ export default {
|
|||||||
uniq(items, field = 'id') {
|
uniq(items, field = 'id') {
|
||||||
return uniqBy(items, field)
|
return uniqBy(items, field)
|
||||||
},
|
},
|
||||||
showMoreContributions() {
|
showMoreContributions($state) {
|
||||||
const { profilePagePosts: PostQuery } = this.$apollo.queries
|
const { profilePagePosts: PostQuery } = this.$apollo.queries
|
||||||
if (!PostQuery) return // seems this can be undefined on subpages
|
if (!PostQuery) return // seems this can be undefined on subpages
|
||||||
this.offset += this.pageSize
|
this.offset += this.pageSize
|
||||||
@ -391,6 +391,7 @@ export default {
|
|||||||
updateQuery: (previousResult, { fetchMoreResult }) => {
|
updateQuery: (previousResult, { fetchMoreResult }) => {
|
||||||
if (!fetchMoreResult || fetchMoreResult.profilePagePosts.length < this.pageSize) {
|
if (!fetchMoreResult || fetchMoreResult.profilePagePosts.length < this.pageSize) {
|
||||||
this.hasMore = false
|
this.hasMore = false
|
||||||
|
$state.complete()
|
||||||
}
|
}
|
||||||
const result = {
|
const result = {
|
||||||
...previousResult,
|
...previousResult,
|
||||||
@ -404,6 +405,7 @@ export default {
|
|||||||
...fetchMoreResult.profilePagePosts,
|
...fetchMoreResult.profilePagePosts,
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
$state.loaded()
|
||||||
return result
|
return result
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user