mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-31 03:08:29 +08:00
not incrementing incomplete seconds when saving is disabled
This commit is contained in:
parent
34e5174609
commit
ffb19eff80
1 changed files with 10 additions and 19 deletions
|
|
@ -438,25 +438,15 @@ export function restart(options = {} as RestartOptions): void {
|
|||
options.withSameWordset = true;
|
||||
}
|
||||
|
||||
TestInput.pushKeypressesToHistory();
|
||||
const testSeconds = TestStats.calculateTestSeconds(performance.now());
|
||||
const afkseconds = TestStats.calculateAfkSeconds(testSeconds);
|
||||
// incompleteTestSeconds += ;
|
||||
let tt = testSeconds - afkseconds;
|
||||
if (tt < 0) tt = 0;
|
||||
// console.log(
|
||||
// `increasing incomplete time by ${tt}s (${testSeconds}s - ${afkseconds}s afk)`
|
||||
// );
|
||||
TestStats.incrementIncompleteSeconds(tt);
|
||||
TestStats.incrementRestartCount();
|
||||
// if (tt > 600) {
|
||||
// Notifications.add(
|
||||
// `Your time typing just increased by ${Misc.roundTo2(
|
||||
// tt / 60
|
||||
// )} minutes. If you think this is incorrect please contact Miodec and dont refresh the website.`,
|
||||
// -1
|
||||
// );
|
||||
// }
|
||||
if (TestState.savingEnabled) {
|
||||
TestInput.pushKeypressesToHistory();
|
||||
const testSeconds = TestStats.calculateTestSeconds(performance.now());
|
||||
const afkseconds = TestStats.calculateAfkSeconds(testSeconds);
|
||||
let tt = testSeconds - afkseconds;
|
||||
if (tt < 0) tt = 0;
|
||||
TestStats.incrementIncompleteSeconds(tt);
|
||||
TestStats.incrementRestartCount();
|
||||
}
|
||||
}
|
||||
|
||||
if (Config.mode == "zen") {
|
||||
|
|
@ -1800,6 +1790,7 @@ export function fail(reason: string): void {
|
|||
// corrected.pushHistory();
|
||||
TestInput.pushKeypressesToHistory();
|
||||
finish(true);
|
||||
if (!TestState.savingEnabled) return;
|
||||
const testSeconds = TestStats.calculateTestSeconds(performance.now());
|
||||
const afkseconds = TestStats.calculateAfkSeconds(testSeconds);
|
||||
let tt = testSeconds - afkseconds;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue