Seed subscription videos map and reuse playback handler

This commit is contained in:
thePR0M3TH3AN committed 2025-09-23 09:29:49 -04:00
1 parent fe0b89697f
commit 0e0249ff91
1 file changed
+9
+9
View File
@@ -261,6 +261,10 @@ class SubscriptionsManager {
return;
}
// Keep the global videos map up to date so delegated playback handlers
// can reuse the already fetched metadata for this event.
window.app?.videosMap?.set(video.id, video);
localAuthorSet.add(video.pubkey);
const nevent = window.NostrTools.nip19.neventEncode({ id: video.id });
@@ -398,6 +402,11 @@ class SubscriptionsManager {
container.appendChild(fragment);
if (window.app) {
window.app.videoList = container;
window.app.attachVideoListHandler?.();
}
// Lazy-load
const lazyEls = container.querySelectorAll("[data-lazy]");
lazyEls.forEach((el) => window.app?.mediaLoader.observe(el));