mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-04 03:42:26 +00:00
Fix: prevent thumbnail cache from being cleared on empty video lists
This commit addresses an issue where thumbnail images would "drop" (disappear/flicker) upon login or re-initialization of the video list. Changes: - Modified `js/ui/views/VideoListView.js` to add a guard clause in `cleanupThumbnailCache`. - The function now returns early if the provided `videos` list is empty, preserving the existing `loadedThumbnails` cache during transient loading states. Verification: - Created a reproduction script (`reproduce_issue.mjs`) that confirmed the cache was being cleared on empty input. - Verified the fix with the same script, ensuring the cache is preserved. - Verified no regression in `npm run lint:hex` and `npm run lint:inline-styles`.
This commit is contained in:
1 parent
e162ee355d
commit
31751579a3
1 file changed
+4
@@ -1011,6 +1011,10 @@ export class VideoListView {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Array.isArray(videos) || videos.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const activeIds = new Set();
|
||||
videos.forEach((video) => {
|
||||
if (video && typeof video.id === "string" && video.id) {
|
||||
|
||||
Reference in new issue
Block a user