mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-02-04 07:47:33 +00:00
refactor: update WebSocket connection effect to depend on token changes for reconnection
This commit is contained in:
@@ -46,7 +46,7 @@ const useWebSocketProviderState = (): WebSocketContextType => {
|
|||||||
wsRef.current.close();
|
wsRef.current.close();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}, []); // Keep dependency array but add proper cleanup
|
}, [token]); // everytime token changes, we reconnect
|
||||||
|
|
||||||
const connect = useCallback(() => {
|
const connect = useCallback(() => {
|
||||||
if (unmountedRef.current) return; // Prevent connection if unmounted
|
if (unmountedRef.current) return; // Prevent connection if unmounted
|
||||||
|
|||||||
Reference in New Issue
Block a user