Compare commits

...

2 Commits

Author SHA1 Message Date
github-actions[bot] 25c03f2b0d chore: bump version to 0.0.102 [skip ci] 2026-09-03 13:18:35 +00:00
truewhile a56b1801f9 bug处理 2026-09-03 21:18:20 +08:00
3 changed files with 13 additions and 21 deletions
+1 -1
View File
@@ -1 +1 @@
0.0.101
0.0.102
+6 -10
View File
@@ -80,11 +80,11 @@ export function HomePage() {
const sortedLibraries = useMemo(() => sortByPinnedIds(libraries, pinnedIds), [libraries, pinnedIds])
// 按需拉取卡片预览管理
const [fetchedLibIds, setFetchedLibIds] = useState<Set<string>>(new Set())
const fetchedLibIdsRef = useRef<Set<string>>(new Set())
const fetchingRef = useRef<Set<string>>(new Set())
const fetchPreviews = useCallback(async (ids: string[]) => {
const targets = ids.filter((id) => !fetchedLibIds.has(id) && !fetchingRef.current.has(id))
const targets = ids.filter((id) => !fetchedLibIdsRef.current.has(id) && !fetchingRef.current.has(id))
if (targets.length === 0) return
targets.forEach((id) => fetchingRef.current.add(id))
@@ -104,16 +104,12 @@ export function HomePage() {
} catch {
// 容错
} finally {
setFetchedLibIds((prev) => {
const next = new Set(prev)
targets.forEach((id) => {
next.add(id)
fetchingRef.current.delete(id)
})
return next
targets.forEach((id) => {
fetchedLibIdsRef.current.add(id)
fetchingRef.current.delete(id)
})
}
}, [fetchedLibIds])
}, [])
// 3. 首屏优先加载:轮播图库 + 媒体库卡片区前 20 个库 + 首屏前 3 个内容行
useEffect(() => {
+6 -10
View File
@@ -23,11 +23,11 @@ export function LibrariesPage() {
const [repairEpisodeArtwork, setRepairEpisodeArtwork] = useState(false)
const [repairMsg, setRepairMsg] = useState('')
const [fetchedLibIds, setFetchedLibIds] = useState<Set<string>>(new Set())
const fetchedLibIdsRef = useRef<Set<string>>(new Set())
const fetchingRef = useRef<Set<string>>(new Set())
const fetchPreviews = useCallback(async (ids: string[]) => {
const targets = ids.filter((id) => !fetchedLibIds.has(id) && !fetchingRef.current.has(id))
const targets = ids.filter((id) => !fetchedLibIdsRef.current.has(id) && !fetchingRef.current.has(id))
if (targets.length === 0) return
targets.forEach((id) => fetchingRef.current.add(id))
@@ -46,16 +46,12 @@ export function LibrariesPage() {
} catch {
// 容错
} finally {
setFetchedLibIds((prev) => {
const next = new Set(prev)
targets.forEach((id) => {
next.add(id)
fetchingRef.current.delete(id)
})
return next
targets.forEach((id) => {
fetchedLibIdsRef.current.add(id)
fetchingRef.current.delete(id)
})
}
}, [fetchedLibIds])
}, [])
const loadLibraries = useCallback(async () => {
setLoading(true)