fix: Handle error when lazy loading in favourite
This commit is contained in:
parent
a791a70e41
commit
87801766f4
|
@ -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'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue