Add DM decryption on new contact advert

This commit is contained in:
Jack Kingsman
2026-01-18 23:13:45 -08:00
parent 71ac7f1c6e
commit 43b7e94b0a
12 changed files with 290 additions and 234 deletions
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
+1 -1
View File
@@ -13,7 +13,7 @@
<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-CSUvhn5B.js"></script>
<script type="module" crossorigin src="/assets/index-Cjj7DnBW.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-C-fUaa04.css">
</head>
<body>
+5
View File
@@ -137,6 +137,11 @@ export function App() {
description: error.details,
});
},
onSuccess: (success: { message: string; details?: string }) => {
toast.success(success.message, {
description: success.details,
});
},
onContacts: (data: Contact[]) => setContacts(data),
onChannels: (data: Channel[]) => setChannels(data),
onMessage: (msg: Message) => {
+9
View File
@@ -11,6 +11,11 @@ interface ErrorEvent {
details?: string;
}
interface SuccessEvent {
message: string;
details?: string;
}
interface UseWebSocketOptions {
onHealth?: (health: HealthStatus) => void;
onContacts?: (contacts: Contact[]) => void;
@@ -20,6 +25,7 @@ interface UseWebSocketOptions {
onRawPacket?: (packet: RawPacket) => void;
onMessageAcked?: (messageId: number, ackCount: number, paths?: MessagePath[]) => void;
onError?: (error: ErrorEvent) => void;
onSuccess?: (success: SuccessEvent) => void;
}
export function useWebSocket(options: UseWebSocketOptions) {
@@ -94,6 +100,9 @@ export function useWebSocket(options: UseWebSocketOptions) {
case 'error':
options.onError?.(msg.data as ErrorEvent);
break;
case 'success':
options.onSuccess?.(msg.data as SuccessEvent);
break;
case 'pong':
// Heartbeat response, ignore
break;