diff --git a/client/src/components/game/GamePage.tsx b/client/src/components/game/GamePage.tsx index 4f887d4..faeac4d 100644 --- a/client/src/components/game/GamePage.tsx +++ b/client/src/components/game/GamePage.tsx @@ -34,7 +34,7 @@ export default function GamePage({ initialLobby }: { initialLobby: Game }) { check: {} }); - const [moveFrom, setMoveFrom] = useState(""); + const [moveFrom, setMoveFrom] = useState(null); const [chatMessages, setChatMessages] = useState([]); const [boardWidth, setBoardWidth] = useState(480); @@ -193,8 +193,6 @@ export default function GamePage({ initialLobby }: { initialLobby: Game }) { updateCustomSquares({ options: {} }); - console.log(m); - console.log(err); return false; } } @@ -268,7 +266,7 @@ export default function GamePage({ initialLobby }: { initialLobby: Game }) { } // from square - if (!moveFrom) { + if (moveFrom === null) { resetFirstMove(square); return; } @@ -283,7 +281,7 @@ export default function GamePage({ initialLobby }: { initialLobby: Game }) { if (!move) { resetFirstMove(square); } else { - setMoveFrom(""); + setMoveFrom(null); socket.emit("sendMove", moveDetails); } }