Skip to content

Commit

Permalink
fix (client): use-socket.tsx disconnect event
Browse files Browse the repository at this point in the history
  • Loading branch information
MHP24 committed Mar 17, 2024
1 parent 7e870c1 commit a7aa84d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions client/src/hooks/use-socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ export const useSocket = (serverPath: string) => {
}

const disconnect = () => {
if (socket) {
socket.disconnect()
setSocket(null)
}
socket?.disconnect()
setSocket(null)
}

// * Event handlers (listener and emitter)
Expand Down

0 comments on commit a7aa84d

Please sign in to comment.