diff --git a/src/main/client/src/Game.jsx b/src/main/client/src/Game.jsx index d58aadf..fc5983e 100644 --- a/src/main/client/src/Game.jsx +++ b/src/main/client/src/Game.jsx @@ -49,8 +49,7 @@ export const Game = () => { let currentPlayer = useGameStore(state => state.currentPlayer) let counting = useGameStore(state => state.counting) let currentColor = useGameStore(state => state.currentColor) - let {board, forbidden, gameHasEnded} = useGameStore(state => state.gameState) - let [forbidden_x, forbidden_y] = forbidden + let {board, forbidden: [forbidden_x, forbidden_y], gameHasEnded} = useGameStore(state => state.gameState) let initialized = useRef() let canvasRef = useRef() let countingGroup = !gameHasEnded && counting() ? getCountingGroup(board, cursor_x, cursor_y) : undefined diff --git a/src/main/client/src/feature/OpenGames.jsx b/src/main/client/src/feature/OpenGames.jsx index f43a1ee..4285e86 100644 --- a/src/main/client/src/feature/OpenGames.jsx +++ b/src/main/client/src/feature/OpenGames.jsx @@ -141,14 +141,14 @@ function OpenGame({game, acceptableGame, setAcceptableGame}) { function AcceptDialog({acceptableGame, onAccept}) { let { top, right } = acceptableGame.rect let [isFlip, setFlip] = useState(false) - let [handi, setHandi] = useState(0) + let [handi, setHandi] = useState(1) let auth = useAuthStore(state => state.auth) return (
onAccept({ game: acceptableGame.game, flip: isFlip, - handicap: handi, + handicap: handi === 1 ? 0 : handi, })} style={{ position: "absolute", @@ -171,18 +171,18 @@ function AcceptDialog({acceptableGame, onAccept}) {
Handicap: - - {handi === 0 ? 0 : handi + 1} + {handi === 1 ? "0" : handi}