From ddb6dcb113faae45a1cf60e7b088b404971de6c9 Mon Sep 17 00:00:00 2001 From: you Date: Sat, 21 Mar 2026 21:41:30 +0000 Subject: [PATCH] fix: tick channel list relative timestamps every 30s timeAgo labels were computed once on render and never updated, showing stale '11h ago' until next WS message triggered re-render. Added 30s interval to re-render channel list, cleaned up on destroy. --- public/channels.js | 7 +++++++ public/index.html | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/public/channels.js b/public/channels.js index 707f9913..2dfe36a5 100644 --- a/public/channels.js +++ b/public/channels.js @@ -485,11 +485,18 @@ } } }); + + // Tick relative timestamps every 30s + timeAgoTimer = setInterval(renderChannelList, 30000); } + var timeAgoTimer = null; + function destroy() { if (wsHandler) offWS(wsHandler); wsHandler = null; + if (timeAgoTimer) clearInterval(timeAgoTimer); + timeAgoTimer = null; if (regionChangeHandler) RegionFilter.offChange(regionChangeHandler); regionChangeHandler = null; channels = []; diff --git a/public/index.html b/public/index.html index 7e59d770..9317455a 100644 --- a/public/index.html +++ b/public/index.html @@ -86,7 +86,7 @@ - +