Purge dead WS handlers from back when we loaded contacts + chans over WS not API

This commit is contained in:
Jack Kingsman
2026-02-12 00:36:24 -08:00
parent 7e7330eb12
commit 2248a13cde
6 changed files with 245 additions and 34 deletions
+1 -9
View File
@@ -1,5 +1,5 @@
import { useEffect, useRef, useCallback, useState } from 'react';
import type { HealthStatus, Contact, Channel, Message, MessagePath, RawPacket } from './types';
import type { HealthStatus, Contact, Message, MessagePath, RawPacket } from './types';
interface WebSocketMessage {
type: string;
@@ -18,8 +18,6 @@ interface SuccessEvent {
interface UseWebSocketOptions {
onHealth?: (health: HealthStatus) => void;
onContacts?: (contacts: Contact[]) => void;
onChannels?: (channels: Channel[]) => void;
onMessage?: (message: Message) => void;
onContact?: (contact: Contact) => void;
onRawPacket?: (packet: RawPacket) => void;
@@ -100,12 +98,6 @@ export function useWebSocket(options: UseWebSocketOptions) {
case 'health':
handlers.onHealth?.(msg.data as HealthStatus);
break;
case 'contacts':
handlers.onContacts?.(msg.data as Contact[]);
break;
case 'channels':
handlers.onChannels?.(msg.data as Channel[]);
break;
case 'message':
handlers.onMessage?.(msg.data as Message);
break;