Skip to content

Commit

Permalink
fixes black incorrectly starting with increment time
Browse files Browse the repository at this point in the history
  • Loading branch information
arimourao authored and franciscoBSalgueiro committed Dec 4, 2024
1 parent cd4344c commit 7f4ebbd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/boards/BoardGame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,13 @@ function BoardGame() {
}
if (pos?.turn === "white" && blackTime !== null) {
setBlackTime(
(prev) => prev! + (players.black.timeControl?.increment ?? 0),
(prev) => {
if (pos?.fullmoves === 1) {
return prev!;
}

return prev! + (players.black.timeControl?.increment ?? 0);
}
);
}
setIntervalId(intervalId);
Expand Down

0 comments on commit 7f4ebbd

Please sign in to comment.