|
|
|
@ -131,11 +131,12 @@ export default {
|
|
|
|
|
methods: {
|
|
|
|
|
onIntersect (entries, observer, isIntersecting) {
|
|
|
|
|
if (isIntersecting) {
|
|
|
|
|
this.fetch()
|
|
|
|
|
this.fetch(true)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async fetch () {
|
|
|
|
|
async fetch (silent = false) {
|
|
|
|
|
this.isLoading = true
|
|
|
|
|
try {
|
|
|
|
|
const results = await this.$apollo.query({
|
|
|
|
|
query: gql`
|
|
|
|
|
query ($locale: String!, $path: String!) {
|
|
|
|
@ -165,6 +166,16 @@ export default {
|
|
|
|
|
c.initials = initials
|
|
|
|
|
return c
|
|
|
|
|
})
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.warn(err)
|
|
|
|
|
if (!silent) {
|
|
|
|
|
this.$store.commit('showNotification', {
|
|
|
|
|
style: 'red',
|
|
|
|
|
message: err.message,
|
|
|
|
|
icon: 'alert'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.isLoading = false
|
|
|
|
|
this.hasLoadedOnce = true
|
|
|
|
|
},
|
|
|
|
@ -214,6 +225,7 @@ export default {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const resp = await this.$apollo.mutate({
|
|
|
|
|
mutation: gql`
|
|
|
|
|
mutation (
|
|
|
|
@ -264,9 +276,12 @@ export default {
|
|
|
|
|
this.$vuetify.goTo(`#comment-post-id-${_.get(resp, 'data.comments.create.id', 0)}`, this.scrollOpts)
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
throw new Error(_.get(resp, 'data.comments.create.responseResult.message', 'An unexpected error occured.'))
|
|
|
|
|
}
|
|
|
|
|
} catch (err) {
|
|
|
|
|
this.$store.commit('showNotification', {
|
|
|
|
|
style: 'red',
|
|
|
|
|
message: _.get(resp, 'data.comments.create.responseResult.message', 'An unexpected error occured.'),
|
|
|
|
|
message: err.message,
|
|
|
|
|
icon: 'alert'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
@ -286,6 +301,7 @@ export default {
|
|
|
|
|
this.isBusy = true
|
|
|
|
|
this.deleteCommentDialogShown = false
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const resp = await this.$apollo.mutate({
|
|
|
|
|
mutation: gql`
|
|
|
|
|
mutation (
|
|
|
|
@ -319,9 +335,12 @@ export default {
|
|
|
|
|
|
|
|
|
|
this.comments = _.reject(this.comments, ['id', this.commentToDelete.id])
|
|
|
|
|
} else {
|
|
|
|
|
throw new Error(_.get(resp, 'data.comments.delete.responseResult.message', 'An unexpected error occured.'))
|
|
|
|
|
}
|
|
|
|
|
} catch (err) {
|
|
|
|
|
this.$store.commit('showNotification', {
|
|
|
|
|
style: 'red',
|
|
|
|
|
message: _.get(resp, 'data.comments.delete.responseResult.message', 'An unexpected error occured.'),
|
|
|
|
|
message: err.message,
|
|
|
|
|
icon: 'alert'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
@ -362,6 +381,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
img {
|
|
|
|
|
max-width: 100%;
|
|
|
|
|
border-radius: 5px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
code {
|
|
|
|
|