From 6f64ed6b9b06e2f68563d7ddc21cdcfa6fdbb27f Mon Sep 17 00:00:00 2001 From: you Date: Sat, 21 Mar 2026 22:15:25 +0000 Subject: [PATCH] fix: tick channel timeAgo labels every 1s instead of re-rendering every 30s --- public/channels.js | 8 ++++++-- public/index.html | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/public/channels.js b/public/channels.js index 11d58c05..426632d3 100644 --- a/public/channels.js +++ b/public/channels.js @@ -487,7 +487,11 @@ }); // Tick relative timestamps every 30s - timeAgoTimer = setInterval(renderChannelList, 30000); + timeAgoTimer = setInterval(function () { + document.querySelectorAll('.ch-item-time[data-ts]').forEach(function (el) { + el.textContent = timeAgo(el.dataset.ts); + }); + }, 1000); } var timeAgoTimer = null; @@ -548,7 +552,7 @@
${escapeHtml(name)} - ${time} + ${time}
${escapeHtml(preview)}
diff --git a/public/index.html b/public/index.html index 3118838a..f188443e 100644 --- a/public/index.html +++ b/public/index.html @@ -86,7 +86,7 @@ - +