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 33880b3 commit 8aa1f51Copy full SHA for 8aa1f51
frontend/src/ts/test/test-stats.ts
@@ -138,11 +138,18 @@ export function setInvalid(): void {
138
}
139
140
export function calculateTestSeconds(now?: number): number {
141
- if (now === undefined) {
142
- return (end - start) / 1000;
143
- } else {
144
- return (now - start) / 1000;
+ let duration = (end - start) / 1000;
+
+ if (now !== undefined) {
+ duration = (now - start) / 1000;
145
+ }
146
147
+ if (Config.mode === "zen" && duration < 0) {
148
+ duration = 0;
149
+ console.log("Zen mode with negative duration detected, setting to 0");
150
151
152
+ return duration;
153
154
155
export function calculateWpmAndRaw(
0 commit comments