Compare commits

...

3 Commits

2 changed files with 7 additions and 2 deletions

View File

@ -90,7 +90,7 @@ export default function Game(props: GameProps): JSX.Element {
</div> </div>
) : ( ) : (
<div> <div>
{maybeIsGameWinner ? "You Lose!" : "You Win!"} {maybeIsGameWinner ? "You Win!" : "You Lose!"}
</div> </div>
)} )}
<div className="player-info"> <div className="player-info">

View File

@ -244,7 +244,12 @@ export default function useServerSocket(
React.useEffect(() => { React.useEffect(() => {
if (state.status !== 'pre-game') return if (state.status !== 'pre-game') return
sendJson({command: 'ready', player_id: state.playerId, match_id: state.matchId}) const intervalId = setInterval(() => {
sendJson({command: 'ready', player_id: state.playerId, match_id: state.matchId})
}, 200)
return () => {
clearInterval(intervalId)
}
}, [sendJson, state]) }, [sendJson, state])
React.useEffect(() => { React.useEffect(() => {