Skip to content

Commit 9ae0e3d

Browse files
committed
Remove timerId reset code (no longer needed!)
1 parent 4ddc6fe commit 9ae0e3d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

server.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,18 +169,17 @@ io.on('connection', function (socket) {
169169
currentPlayerIndex = null;
170170

171171
// Turn off the timer
172-
clearInterval(timerId);
173-
timerId = null;
172+
clearInterval(timerId);
174173
nextTurnChangeTimestamp = null;
175174

176175
// Otherwise, if there are players left,
177176
} else {
178177
// If the disconnected user was the current player, restart timer and change the turn!
179178
if (socket.id === currentPlayerId) {
180179
console.log('\nCURRENT PLAYER disconnected! Restarting turn/timer.\n');
180+
181181
// Turn off the timer
182-
clearInterval(timerId);
183-
timerId = null;
182+
clearInterval(timerId);
184183
nextTurnChangeTimestamp = null;
185184

186185
// Re-initialize the turn (and timer), passing control to the next user

0 commit comments

Comments
 (0)