mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2025-02-07 12:53:57 +01:00
fix: Handle error when lazy loading in local
This commit is contained in:
parent
fb64cd6614
commit
5950db40fb
@ -70,6 +70,12 @@ export default {
|
||||
onScroll (event) {
|
||||
if (((event.target.clientHeight + event.target.scrollTop) >= document.getElementById('local').clientHeight - 10) && !this.lazyloading) {
|
||||
this.$store.dispatch('TimelineSpace/Contents/Local/lazyFetchTimeline', this.timeline[this.timeline.length - 1])
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
message: 'Could not fetch timeline',
|
||||
type: 'error'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -70,6 +70,9 @@ const Local = {
|
||||
ipcRenderer.send('stop-local-streaming')
|
||||
},
|
||||
lazyFetchTimeline ({ 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