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

537
frontend/dist/assets/index-BAMaL3S8.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -13,8 +13,8 @@
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="manifest" href="/site.webmanifest" />
<script type="module" crossorigin src="/assets/index-BW3IACj-.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-URSnSHtR.css">
<script type="module" crossorigin src="/assets/index-BAMaL3S8.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Dtp6aYf1.css">
</head>
<body>
<div id="root"></div>

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') && (

View File

@@ -36,3 +36,4 @@ export function formatTime(timestamp: number): string {
const dateStr = date.toLocaleDateString([], { month: 'short', day: 'numeric' });
return `${dateStr} ${time}`;
}