Skip to content

Commit

Permalink
Pause auto clicking when window is hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
Iapetus-11 committed Nov 30, 2024
1 parent 1e116e5 commit 4ba480e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/views/game/GameView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
.reduce((sum, cur) => sum + cur);
});
useInterval(async () => {
if (document.hidden) {
return;
}
let wholeClicks = Math.floor(autoClicksPerSecond.value);
state.value.fractionClicks += autoClicksPerSecond.value - wholeClicks;
Expand Down

0 comments on commit 4ba480e

Please sign in to comment.