Skip to content

Commit

Permalink
Close #18, only current player can type
Browse files Browse the repository at this point in the history
  • Loading branch information
LearningNerd committed Jul 4, 2017
1 parent dbf7d64 commit 3a9a59c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions public/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@ function handleGameState (serverGameState) {
updateCurrentTurnView(getCurrentPlayer().login);
updateNextTurnView(getCurrentPlayer().login);
toggleMyTurnHighlight();

// If user is the current player, let them type!
if ( socket.id === getCurrentPlayerId() ) {
editor.setReadOnly(false);
}
}

// When receiving new player list data from server
Expand Down

0 comments on commit 3a9a59c

Please sign in to comment.