fix: Handle error when lazy loading in favourite

This commit is contained in:
AkiraFukushima 2018-04-14 21:53:17 +09:00
parent a791a70e41
commit 87801766f4
2 changed files with 9 additions and 0 deletions

View File

@ -57,6 +57,12 @@ export default {
onScroll (event) {
if (((event.target.clientHeight + event.target.scrollTop) >= document.getElementById('favourites').clientHeight - 10) && !this.lazyloading) {
this.$store.dispatch('TimelineSpace/Contents/Favourites/lazyFetchFavourites', this.favourites[this.favourites.length - 1])
.catch(() => {
this.$message({
message: 'Could not fetch favourites',
type: 'error'
})
})
}
}
}

View File

@ -50,6 +50,9 @@ const Favourites = {
})
},
lazyFetchFavourites ({ state, commit, rootState }, last) {
if (last === undefined || last === null) {
return null
}
return new Promise((resolve, reject) => {
if (state.lazyLoading) {
return resolve()