aboutsummaryrefslogtreecommitdiff
path: root/src/components/MultiplayerGrid.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/MultiplayerGrid.js')
-rw-r--r--src/components/MultiplayerGrid.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/components/MultiplayerGrid.js b/src/components/MultiplayerGrid.js
index d26fb31..88a8259 100644
--- a/src/components/MultiplayerGrid.js
+++ b/src/components/MultiplayerGrid.js
@@ -29,6 +29,9 @@ const MultiplayerGrid = (props) => {
const turn = props.turn;
const getBoard = (index) => {
+ // if it's not your turn you can't play
+ if ((turn === 0) === props.isHost) return;
+
const newBoard = board.slice(0, index).concat(turn).concat(board.slice(index+1, 9));
socket.emit("update-remote-data", {
board: newBoard,