fix: Handle error when lazy loading in public
This commit is contained in:
parent
5950db40fb
commit
85c77e4aa3
|
@ -70,6 +70,12 @@ export default {
|
||||||
onScroll (event) {
|
onScroll (event) {
|
||||||
if (((event.target.clientHeight + event.target.scrollTop) >= document.getElementById('public').clientHeight - 10) && !this.lazyloading) {
|
if (((event.target.clientHeight + event.target.scrollTop) >= document.getElementById('public').clientHeight - 10) && !this.lazyloading) {
|
||||||
this.$store.dispatch('TimelineSpace/Contents/Public/lazyFetchTimeline', this.timeline[this.timeline.length - 1])
|
this.$store.dispatch('TimelineSpace/Contents/Public/lazyFetchTimeline', this.timeline[this.timeline.length - 1])
|
||||||
|
.catch(() => {
|
||||||
|
this.$message({
|
||||||
|
message: 'Could not fetch timeline',
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,9 @@ const Public = {
|
||||||
ipcRenderer.send('stop-public-streaming')
|
ipcRenderer.send('stop-public-streaming')
|
||||||
},
|
},
|
||||||
lazyFetchTimeline ({ state, commit, rootState }, last) {
|
lazyFetchTimeline ({ state, commit, rootState }, last) {
|
||||||
|
if (last === undefined || last === null) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (state.lazyLoading) {
|
if (state.lazyLoading) {
|
||||||
return resolve()
|
return resolve()
|
||||||
|
|
Loading…
Reference in New Issue