From b504faf909982d256d04cf46eaf7070ccda5a494 Mon Sep 17 00:00:00 2001 From: Trevor Mears Date: Sun, 28 Dec 2025 19:35:10 -0800 Subject: [PATCH] Implemented cache clearing in channel list --- public/js/components/ChannelList.js | 10 ++++++++++ public/js/pages/Home.js | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/public/js/components/ChannelList.js b/public/js/components/ChannelList.js index 1c8f853..92f37a7 100644 --- a/public/js/components/ChannelList.js +++ b/public/js/components/ChannelList.js @@ -172,6 +172,16 @@ class ChannelList { } } + /** + * Clear program info cache + * Useful when EPG data has been updated + */ + clearProgramInfoCache() { + if (this._programInfoCache) { + this._programInfoCache.clear(); + } + } + escapeHtml(text) { if (!text) return ''; return text diff --git a/public/js/pages/Home.js b/public/js/pages/Home.js index df05f0f..462fe58 100644 --- a/public/js/pages/Home.js +++ b/public/js/pages/Home.js @@ -16,6 +16,10 @@ class HomePage { // Silently fetch EPG data for sidebar info try { await this.app.epgGuide.fetchEpgData(); + + // Clear cache so we don't get stale "null" results from initial render + this.app.channelList.clearProgramInfoCache(); + // Update program info in existing DOM elements without re-rendering this.updateProgramInfo(); } catch (err) {