From 247502e6ca5de94a21be8f2e31aaec9ff8abf478 Mon Sep 17 00:00:00 2001 From: Sudo-Ivan Date: Mon, 9 Mar 2026 12:36:33 -0500 Subject: [PATCH] Add time ago functionality to MessagesSidebar component --- .../src/frontend/components/messages/MessagesSidebar.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/meshchatx/src/frontend/components/messages/MessagesSidebar.vue b/meshchatx/src/frontend/components/messages/MessagesSidebar.vue index 1c755f0..6d22b4a 100644 --- a/meshchatx/src/frontend/components/messages/MessagesSidebar.vue +++ b/meshchatx/src/frontend/components/messages/MessagesSidebar.vue @@ -303,6 +303,7 @@ GlobalState.config.banished_effect_enabled && isBlocked(conversation.destination_hash), selectionMode, selectedHashes.has(conversation.destination_hash), + timeAgoTick, ]" class="flex cursor-pointer p-2 border-l-2 relative group conversation-item" :class="[ @@ -567,6 +568,7 @@ peer.snr, selectedDestinationHash === peer.destination_hash, GlobalState.config.banished_effect_enabled && isBlocked(peer.destination_hash), + timeAgoTick, ]" class="flex cursor-pointer p-2 border-l-2 relative" :class="[ @@ -772,6 +774,7 @@ export default { return { GlobalState, tab: "conversations", + timeAgoTick: 0, foldersExpanded, selectionMode: false, selectedHashes: new Set(), @@ -852,11 +855,15 @@ export default { }, }, mounted() { - // listen for contact updates GlobalEmitter.on("contact-updated", this.onContactUpdated); + const tickMs = 60 * 1000; + this._timeAgoInterval = setInterval(() => { + this.timeAgoTick = Date.now(); + }, tickMs); }, unmounted() { GlobalEmitter.off("contact-updated", this.onContactUpdated); + if (this._timeAgoInterval) clearInterval(this._timeAgoInterval); }, methods: { onContactUpdated(data) {