diff --git a/src/contexts/WebSocketContext.tsx b/src/contexts/WebSocketContext.tsx index f0701d3..ad31f66 100644 --- a/src/contexts/WebSocketContext.tsx +++ b/src/contexts/WebSocketContext.tsx @@ -46,7 +46,7 @@ const useWebSocketProviderState = (): WebSocketContextType => { wsRef.current.close(); } }; - }, []); // Keep dependency array but add proper cleanup + }, [token]); // everytime token changes, we reconnect const connect = useCallback(() => { if (unmountedRef.current) return; // Prevent connection if unmounted