Skip to content

Commit

Permalink
feat: disconect all users when game ends
Browse files Browse the repository at this point in the history
  • Loading branch information
iaurg committed Aug 10, 2023
1 parent bdf815a commit 8f42c74
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/src/contexts/GameContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ export const GameProvider = ({ children }: GameProviderProps) => {

socket.current.on("gameFinished", (data: any) => {
console.log("gameFinished", data);
socket.current?.emit("finishGame");
socket.current?.disconnect();
setGameFinishedData(data);
setGameFinished(true);
});
Expand Down

0 comments on commit 8f42c74

Please sign in to comment.