Skip to content

Commit bf1f320

Browse files
authored
fix: resolve fps counter showing increased fps when opened multiple times (@blru) (monkeytypegame#5990)
1 parent 3df9ca4 commit bf1f320

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

frontend/src/ts/elements/fps-counter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ export function start(): void {
2525
stopLoop = false;
2626
frameCount = 0;
2727
startTime = performance.now();
28-
fpsInterval = window.requestAnimationFrame(loop);
28+
29+
if (!fpsInterval) fpsInterval = window.requestAnimationFrame(loop);
2930
el.classList.remove("hidden");
3031
}
3132

0 commit comments

Comments
 (0)