We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61a10fa commit f62909aCopy full SHA for f62909a
js/game.js
@@ -8,6 +8,7 @@ export default class Game {
8
9
#onTurn = 'X'; // Odd rounds => X starts, even rounds => O starts
10
#end = false;
11
+ #endTimeout = false;
12
#xWins = 0;
13
#oWins = 0;
14
#ties = 0;
@@ -58,6 +59,9 @@ export default class Game {
58
59
}
60
61
#handleClick(e, index) {
62
+ if (this.#endTimeout) {
63
+ return;
64
+ }
65
if (this.#end) {
66
this.#end = false;
67
this.#resetBoard();
@@ -130,6 +134,9 @@ export default class Game {
130
134
})
131
135
132
136
this.#end = true;
137
+ this.#endTimeout = true;
138
+ setTimeout(() => { this.#endTimeout = false; }, 1500);
139
+
133
140
this.#saveScore(winner);
141
this.#updateScore(winner);
142
0 commit comments