fix: some videos disappear on following and subscribed series pages (#786)

This commit is contained in:
Hakadao
2024-05-27 01:57:29 +08:00
parent bad307b827
commit 838d2ea981
2 changed files with 28 additions and 12 deletions

View File

@@ -79,8 +79,20 @@ async function initData() {
}
async function getData() {
for (let i = 0; i < 3; i++)
await getFollowedUsersVideos()
if (isLoading.value)
return
emit('beforeLoading')
isLoading.value = true
try {
for (let i = 0; i < 3; i++)
await getFollowedUsersVideos()
}
finally {
isLoading.value = false
emit('afterLoading')
}
}
async function getFollowedUsersVideos() {
@@ -92,8 +104,6 @@ async function getFollowedUsersVideos() {
return
}
emit('beforeLoading')
isLoading.value = true
try {
let i = 0
// https://github.com/starknt/BewlyBewly/blob/fad999c2e482095dc3840bb291af53d15ff44130/src/contentScripts/views/Home/components/ForYou.vue#L208
@@ -146,8 +156,6 @@ async function getFollowedUsersVideos() {
}
finally {
videoList.value = videoList.value.filter(video => video.item)
isLoading.value = false
emit('afterLoading')
}
}

View File

@@ -64,8 +64,20 @@ async function initData() {
}
async function getData() {
for (let i = 0; i < 3; i++)
await getFollowedUsersVideos()
if (isLoading.value)
return
emit('beforeLoading')
isLoading.value = true
try {
for (let i = 0; i < 3; i++)
await getFollowedUsersVideos()
}
finally {
isLoading.value = false
emit('afterLoading')
}
}
function initPageAction() {
@@ -96,8 +108,6 @@ async function getFollowedUsersVideos() {
return
}
emit('beforeLoading')
isLoading.value = true
try {
let i = 0
// https://github.com/starknt/BewlyBewly/blob/fad999c2e482095dc3840bb291af53d15ff44130/src/contentScripts/views/Home/components/ForYou.vue#L208
@@ -150,8 +160,6 @@ async function getFollowedUsersVideos() {
}
finally {
videoList.value = videoList.value.filter(video => video.item)
isLoading.value = false
emit('afterLoading')
}
}