fix: ensure authenticated graceful shutdown exits process and sort live activity feed by timestamp descending

This commit is contained in:
Riz Ashraf committed 2026-10-04 02:55:56 +01:00
1 parent 3efee96230
commit 91d5565141
5 files changed
+46 -22

No files matched your search

+10 -2
View File
@@ -1141,13 +1141,21 @@
const feed = document.getElementById('activity-feed');
if (!feed) return;
feed.innerHTML = '';
[...history].reverse().forEach(item => {
// Sort history by timestamp descending so newest entries are at top
const sorted = [...history].sort((a, b) => {
const tA = (typeof a === 'object' && a) ? (a.timestamp || a.time || 0) : 0;
const tB = (typeof b === 'object' && b) ? (b.timestamp || b.time || 0) : 0;
return tB - tA;
});
sorted.forEach(item => {
const div = document.createElement('div');
div.className = 'feed-entry';
div.innerHTML = parseActivityPayload(item);
feed.appendChild(div);
});
if (history.length > 0) {
if (sorted.length > 0) {
feed.scrollTop = 0;
}
} catch(e) {