Skip to content

Commit

Permalink
fix: game behaviour after stop and start again
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp-Plotnikov committed Apr 20, 2024
1 parent 29f0388 commit 1fee374
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions game/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ gameStart.addEventListener('click', async (event) => {
button.dataset.isActive = 'true';
gameEnd.dataset.isActive = 'false';
if (!isTimerInProgress()) {
await animate();
animate();
return;
}
await startTimer();
if (isButtonActive(gameStart)) {
await animate();
setTimeout(() => {animate()});
}
});
gameEnd.addEventListener('click', (event) => {
Expand Down

0 comments on commit 1fee374

Please sign in to comment.