- this.clockUpdate = setInterval(() => {
- if (
- countdown < 0 ||
- this.game.moves.length > currentMovesCount ||
- this.game.score != "*"
- ) {
- clearInterval(this.clockUpdate);
- if (countdown < 0)
- this.gameOver(
- currentTurn == "w" ? "0-1" : "1-0",
- "Time"
+ this.clockUpdate = setInterval(
+ () => {
+ if (
+ countdown < 0 ||
+ this.game.moves.length > currentMovesCount ||
+ this.game.score != "*"
+ ) {
+ clearInterval(this.clockUpdate);
+ if (countdown < 0)
+ this.gameOver(
+ currentTurn == "w" ? "0-1" : "1-0",
+ "Time"
+ );
+ } else
+ this.$set(
+ this.virtualClocks,
+ colorIdx,
+ ppt(Math.max(0, --countdown)).split(':')