mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
chore: lgfm
This commit is contained in:
@@ -6,7 +6,6 @@ import AnimeCardSkeleton from './components/AnimeCardSkeleton.vue'
|
||||
import type { AnimeItem, PopularAnime } from './types'
|
||||
import { getUserID, openLinkToNewTab } from '~/utils/main'
|
||||
import { numFormatter } from '~/utils/dataFormatter'
|
||||
import { settings } from '~/logic'
|
||||
import emitter from '~/utils/mitt'
|
||||
|
||||
const animeWatchList = reactive<AnimeItem[]>([])
|
||||
@@ -23,6 +22,7 @@ onMounted(() => {
|
||||
getPopularAnimeList()
|
||||
getRecommendAnimeList()
|
||||
|
||||
emitter.off('reachBottom')
|
||||
emitter.on('reachBottom', () => {
|
||||
if (!isLoadingRecommendAnime.value)
|
||||
getRecommendAnimeList()
|
||||
@@ -30,8 +30,7 @@ onMounted(() => {
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
// remove the global window.onscroll event
|
||||
window.onscroll = () => {}
|
||||
emitter.off('reachBottom')
|
||||
})
|
||||
|
||||
function getAnimeWatchList() {
|
||||
|
||||
@@ -110,8 +110,11 @@ onMounted(() => {
|
||||
if (
|
||||
mainAppRef.value.clientHeight + mainAppRef.value.scrollTop
|
||||
>= mainAppRef.value.scrollHeight - 20
|
||||
)
|
||||
emitter.emit('reachBottom')
|
||||
) {
|
||||
nextTick(() => {
|
||||
emitter.emit('reachBottom')
|
||||
})
|
||||
}
|
||||
|
||||
if (mainAppRef.value.scrollTop === 0)
|
||||
showTopbarMask.value = false
|
||||
|
||||
@@ -36,6 +36,7 @@ onMounted(() => {
|
||||
getHistoryList()
|
||||
getHistoryPauseStatus()
|
||||
|
||||
emitter.off('reachBottom')
|
||||
emitter.on('reachBottom', () => {
|
||||
if (isLoading.value)
|
||||
return
|
||||
@@ -48,6 +49,10 @@ onMounted(() => {
|
||||
})
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
emitter.off('reachBottom')
|
||||
})
|
||||
|
||||
/**
|
||||
* Get history list
|
||||
*/
|
||||
|
||||
@@ -33,19 +33,24 @@ onMounted(async () => {
|
||||
}
|
||||
}, 200)
|
||||
|
||||
emitter.off('reachBottom')
|
||||
emitter.on('reachBottom', () => {
|
||||
if (!isLoading.value) {
|
||||
if (settings.value.recommendationMode === 'web') {
|
||||
getRecommendVideos()
|
||||
}
|
||||
else {
|
||||
for (let i = 0; i < 3; i++)
|
||||
getAppRecommendVideos()
|
||||
// for (let i = 0; i < 3; i++)
|
||||
getAppRecommendVideos()
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
emitter.off('reachBottom')
|
||||
})
|
||||
|
||||
async function getRecommendVideos() {
|
||||
isLoading.value = true
|
||||
try {
|
||||
|
||||
@@ -15,11 +15,6 @@ onMounted(() => {
|
||||
getAllWatchLaterList()
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
// remove the global window.onscroll event
|
||||
window.onscroll = () => {}
|
||||
})
|
||||
|
||||
/**
|
||||
* Get watch later list
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user