mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Fix nullpointer issues
It seems that `this.$apollo.queries.Post` can be undefined sometimes. Honestly I don't know why but I could imagine that it might happen on subpages and when the cypress test triggers the infinite loader, we face this bug.
This commit is contained in:
parent
da57e9391c
commit
0fca14a29e
@ -125,12 +125,6 @@ export default {
|
||||
return this.$apollo.loading || (this.posts && this.posts.length > 0)
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
postsFilter() {
|
||||
this.offset = 0
|
||||
this.posts = []
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
toggleOnlySorting(x) {
|
||||
this.offset = 0
|
||||
@ -149,8 +143,11 @@ export default {
|
||||
}).href
|
||||
},
|
||||
showMoreContributions() {
|
||||
const { Post: PostQuery } = this.$apollo.queries
|
||||
if (!PostQuery) return // seems this can be undefined on subpages
|
||||
|
||||
this.offset += this.pageSize
|
||||
this.$apollo.queries.Post.fetchMore({
|
||||
PostQuery.fetchMore({
|
||||
variables: {
|
||||
offset: this.offset,
|
||||
filter: this.finalFilters,
|
||||
|
||||
@ -363,8 +363,11 @@ export default {
|
||||
this.$apollo.queries.User.refetch()
|
||||
},
|
||||
showMoreContributions() {
|
||||
const { Post: PostQuery } = this.$apollo.queries
|
||||
if (!PostQuery) return // seems this can be undefined on subpages
|
||||
|
||||
this.offset += this.pageSize
|
||||
this.$apollo.queries.Post.fetchMore({
|
||||
PostQuery.fetchMore({
|
||||
variables: {
|
||||
offset: this.offset,
|
||||
filter: this.filter,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user