From 0e0249ff91b6771680922b685ab4e66ea5d8ce9c Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Tue, 23 Sep 2025 09:29:49 -0400 Subject: [PATCH] Seed subscription videos map and reuse playback handler --- js/subscriptions.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/subscriptions.js b/js/subscriptions.js index 5bd2372a..fd00d36e 100644 --- a/js/subscriptions.js +++ b/js/subscriptions.js @@ -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));