diff --git a/src/pages/GamePage/hooks/useWebsocket.ts b/src/pages/GamePage/hooks/useWebsocket.ts index 6885ee93..81a430e1 100644 --- a/src/pages/GamePage/hooks/useWebsocket.ts +++ b/src/pages/GamePage/hooks/useWebsocket.ts @@ -125,9 +125,7 @@ const useWebsocket = (roomId: number | null) => { ); }; const onIngameDisconnected = () => { - if (ingameSubscription.current) { - ingameSubscription.current.unsubscribe(); - } + ingameSubscription.current?.unsubscribe(); }; const handleConnectIngame = (roomId: number) => {