Fix loading for cached subscriptions

This commit is contained in:
Preston 2020-09-02 21:04:08 -04:00
parent f895703446
commit 1bf2e51afc
1 changed files with 19 additions and 17 deletions

View File

@ -115,25 +115,27 @@ export default Vue.extend({
if (dataLimit !== null) {
this.dataLimit = dataLimit
}
setTimeout(async () => {
if (this.profileSubscriptions.videoList.length === 0) {
this.getSubscriptions()
} else {
const subscriptionList = JSON.parse(JSON.stringify(this.profileSubscriptions))
if (this.hideWatchedSubs) {
this.videoList = await Promise.all(subscriptionList.videoList.filter((video) => {
const historyIndex = this.historyCache.findIndex((x) => {
return x.videoId === video.videoId
})
return historyIndex === -1
}))
} else {
this.videoList = subscriptionList.videoList
}
this.isLoading = false
if (this.profileSubscriptions.videoList.length !== 0) {
const subscriptionList = JSON.parse(JSON.stringify(this.profileSubscriptions))
if (this.hideWatchedSubs) {
this.videoList = await Promise.all(subscriptionList.videoList.filter((video) => {
const historyIndex = this.historyCache.findIndex((x) => {
return x.videoId === video.videoId
})
return historyIndex === -1
}))
} else {
this.videoList = subscriptionList.videoList
}
}, 200)
this.isLoading = false
} else {
setTimeout(async () => {
this.getSubscriptions()
}, 200)
}
},
methods: {
getSubscriptions: function () {