fix: Handle error when lazy loading in public

This commit is contained in:
AkiraFukushima 2018-04-14 22:00:59 +09:00
parent 5950db40fb
commit 85c77e4aa3
2 changed files with 9 additions and 0 deletions

View File

@ -70,6 +70,12 @@ export default {
onScroll (event) {
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])
.catch(() => {
this.$message({
message: 'Could not fetch timeline',
type: 'error'
})
})
}
}
}

View File

@ -70,6 +70,9 @@ const Public = {
ipcRenderer.send('stop-public-streaming')
},
lazyFetchTimeline ({ state, commit, rootState }, last) {
if (last === undefined || last === null) {
return null
}
return new Promise((resolve, reject) => {
if (state.lazyLoading) {
return resolve()