Add last-heard time to contacts + repeaters

This commit is contained in:
Jack Kingsman
2026-01-13 13:48:15 -08:00
parent 81132e8a39
commit e211586f4b
7 changed files with 550 additions and 540 deletions
+9
View File
@@ -13,6 +13,7 @@ import { CrackerPanel } from './components/CrackerPanel';
import { Sheet, SheetContent, SheetHeader, SheetTitle } from './components/ui/sheet';
import { Toaster, toast } from './components/ui/sonner';
import { getStateKey } from './utils/conversationState';
import { formatTime } from './utils/messageParser';
import { pubkeysMatch, getContactDisplayName } from './utils/pubkey';
import { parseHashConversation, updateUrlHash } from './utils/urlHash';
import { cn } from '@/lib/utils';
@@ -553,6 +554,14 @@ export function App() {
</span>
<span className="font-normal text-xs text-muted-foreground font-mono truncate">
{activeConversation.id}
{activeConversation.type === 'contact' && (() => {
const contact = contacts.find(c => c.public_key === activeConversation.id);
return contact?.last_seen ? (
<span className="ml-2 font-sans">
(Last heard: {formatTime(contact.last_seen)})
</span>
) : null;
})()}
</span>
</span>
{!(activeConversation.type === 'channel' && activeConversation.name === 'Public') && (
+1
View File
@@ -36,3 +36,4 @@ export function formatTime(timestamp: number): string {
const dateStr = date.toLocaleDateString([], { month: 'short', day: 'numeric' });
return `${dateStr} ${time}`;
}