We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 17a93fe commit efa21b5Copy full SHA for efa21b5
src/hooks/useConnectionState.ts
@@ -15,7 +15,7 @@ export const useConnectionState = (): ConnectionState => {
15
useEffect(() => {
16
const handlerId = uuidv4();
17
18
- sdk?.addConnectionHandler(handlerId, new ConnectionHandler({
+ sdk?.addConnectionHandler?.(handlerId, new ConnectionHandler({
19
onConnected: () => setConnectionState(ConnectionState.OPEN),
20
onDisconnected: () => setConnectionState(ConnectionState.CLOSED),
21
onReconnectStarted: () => setConnectionState(ConnectionState.CONNECTING),
@@ -24,7 +24,7 @@ export const useConnectionState = (): ConnectionState => {
24
}));
25
26
return () => {
27
- sdk?.removeConnectionHandler(handlerId);
+ sdk?.removeConnectionHandler?.(handlerId);
28
};
29
}, [sdk]);
30
0 commit comments