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.
This commit is contained in:
you
2026-03-21 21:41:30 +00:00
parent 746f5cf3b1
commit ddb6dcb113
2 changed files with 8 additions and 1 deletions
+7
View File
@@ -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 = [];
+1 -1
View File
@@ -86,7 +86,7 @@
<script src="home.js?v=1774042199"></script>
<script src="packets.js?v=1774127844"></script>
<script src="map.js?v=1774126708" onerror="console.error('Failed to load:', this.src)"></script>
<script src="channels.js?v=1774129112" onerror="console.error('Failed to load:', this.src)"></script>
<script src="channels.js?v=1774129290" onerror="console.error('Failed to load:', this.src)"></script>
<script src="nodes.js?v=1774126708" onerror="console.error('Failed to load:', this.src)"></script>
<script src="traces.js?v=1774350000" onerror="console.error('Failed to load:', this.src)"></script>
<script src="analytics.js?v=1774126708" onerror="console.error('Failed to load:', this.src)"></script>