aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBlerru <[email protected]>2024-11-04 05:55:43 -0500
committerGitHub <[email protected]>2024-11-04 11:55:43 +0100
commitbf1f3202fbbc120b553e1ce1ccf0917c58b7762c (patch)
treee3e6da975bc0366d771eb8681ae636b4f676b6bc
parent3df9ca4808f8eb62559f47efe6f6b766cf8ca673 (diff)
downloadmonkeytype-bf1f3202fbbc120b553e1ce1ccf0917c58b7762c.tar.gz
monkeytype-bf1f3202fbbc120b553e1ce1ccf0917c58b7762c.zip
fix: resolve fps counter showing increased fps when opened multiple times (@blru) (#5990)
-rw-r--r--frontend/src/ts/elements/fps-counter.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/frontend/src/ts/elements/fps-counter.ts b/frontend/src/ts/elements/fps-counter.ts
index 1616dd6e2..78b4c3afe 100644
--- a/frontend/src/ts/elements/fps-counter.ts
+++ b/frontend/src/ts/elements/fps-counter.ts
@@ -25,7 +25,8 @@ export function start(): void {
stopLoop = false;
frameCount = 0;
startTime = performance.now();
- fpsInterval = window.requestAnimationFrame(loop);
+
+ if (!fpsInterval) fpsInterval = window.requestAnimationFrame(loop);
el.classList.remove("hidden");
}