diff --git a/src/app/api/stats/nodes-over-time/route.ts b/src/app/api/stats/nodes-over-time/route.ts index 955ad52..b7f1ae1 100644 --- a/src/app/api/stats/nodes-over-time/route.ts +++ b/src/app/api/stats/nodes-over-time/route.ts @@ -5,12 +5,12 @@ export async function GET() { try { const query = ` WITH days AS ( - SELECT arrayJoin(range(0, 30)) AS offset, toDate(subtractDays(today(), 29 - offset)) AS day + SELECT arrayJoin(range(0, 7)) AS offset, toDate(subtractDays(today(), 6 - offset)) AS day ), all_nodes AS ( SELECT toDate(ingest_timestamp) AS day, public_key, latitude, longitude FROM meshcore_adverts - WHERE ingest_timestamp >= subtractDays(today(), 30) + WHERE ingest_timestamp >= subtractDays(today(), 7) ), node_days AS ( SELECT public_key, min(day) AS first_seen, any(latitude) AS latitude, any(longitude) AS longitude diff --git a/src/app/stats/page.tsx b/src/app/stats/page.tsx index e14b106..fa02935 100644 --- a/src/app/stats/page.tsx +++ b/src/app/stats/page.tsx @@ -27,6 +27,14 @@ export default function StatsPage() { return (

MeshCore Network Stats

+ +
+

+ Note: The "Nodes Heard Over Time" data shows activity from the past 7 days. + This provides a focused view of recent network activity while maintaining good performance. +

+
+ {loading ? (
Loading...
) : ( diff --git a/src/components/ChatBox.tsx b/src/components/ChatBox.tsx index 5bfd9df..64e3015 100644 --- a/src/components/ChatBox.tsx +++ b/src/components/ChatBox.tsx @@ -108,17 +108,17 @@ export default function ChatBox({ showAllMessagesTab = false, className = "", st
MeshCore Chat {!startExpanded && ( - + )}
diff --git a/src/components/ChatMessageItem.tsx b/src/components/ChatMessageItem.tsx index 86030a9..505b227 100644 --- a/src/components/ChatMessageItem.tsx +++ b/src/components/ChatMessageItem.tsx @@ -36,20 +36,27 @@ export default function ChatMessageItem({ msg, showErrorRow, showChannelId }: { useEffect(() => { let cancelled = false; (async () => { - const result = await decryptMeshcoreGroupMessage({ - encrypted_message: msg.encrypted_message, - mac: msg.mac, - channel_hash: msg.channel_hash, - knownKeys, - parse: true, - }); - if (!cancelled) { - if (result === null) { + try { + const result = await decryptMeshcoreGroupMessage({ + encrypted_message: msg.encrypted_message, + mac: msg.mac, + channel_hash: msg.channel_hash, + knownKeys, + parse: true, + }); + if (!cancelled) { + if (result === null) { + setParsed(null); + setError("Could not decrypt message with any known key."); + } else { + setParsed(result); + setError(null); + } + } + } catch (err) { + if (!cancelled) { setParsed(null); - setError("Could not decrypt message with any known key."); - } else { - setParsed(result); - setError(null); + setError(err instanceof Error ? err.message : "Decryption error occurred."); } } })();