Skip to content

Commit 3a9a59c

Browse files
committed
Close #18, only current player can type
1 parent dbf7d64 commit 3a9a59c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

public/local.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,11 @@ function handleGameState (serverGameState) {
283283
updateCurrentTurnView(getCurrentPlayer().login);
284284
updateNextTurnView(getCurrentPlayer().login);
285285
toggleMyTurnHighlight();
286+
287+
// If user is the current player, let them type!
288+
if ( socket.id === getCurrentPlayerId() ) {
289+
editor.setReadOnly(false);
290+
}
286291
}
287292

288293
// When receiving new player list data from server

0 commit comments

Comments
 (0)