mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2025-01-31 01:27:26 +01:00
fix: Handle error when lazy loading in notification
This commit is contained in:
parent
09bd6f20ea
commit
fb64cd6614
@ -41,6 +41,12 @@ export default {
|
||||
onScroll (event) {
|
||||
if (((event.target.clientHeight + event.target.scrollTop) >= document.getElementById('notifications').clientHeight - 10) && !this.lazyloading) {
|
||||
this.$store.dispatch('TimelineSpace/Contents/Notifications/lazyFetchNotifications', this.notifications[this.notifications.length - 1])
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
message: 'Could not fetch notification',
|
||||
type: 'error'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,9 @@ const Notifications = {
|
||||
},
|
||||
actions: {
|
||||
lazyFetchNotifications ({ state, commit, rootState }, last) {
|
||||
if (last === undefined || last === null) {
|
||||
return null
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
if (state.lazyLoading) {
|
||||
return resolve()
|
||||
|
Loading…
x
Reference in New Issue
Block a user