diff --git a/frontend/src/ts/test/test-input.ts b/frontend/src/ts/test/test-input.ts index 1dfa8cf72d82..c58e088a75d9 100644 --- a/frontend/src/ts/test/test-input.ts +++ b/frontend/src/ts/test/test-input.ts @@ -452,7 +452,7 @@ function updateOverlap(now: number): void { } } -function carryoverFirstKeypress(): void { +export function carryoverFirstKeypress(): void { // Because keydown triggers before input, we need to grab the first keypress data here and carry it over // Take the key with the largest index @@ -487,7 +487,7 @@ function carryoverFirstKeypress(): void { } } -export function resetKeypressTimings(carryover: boolean): void { +function resetKeypressTimings(): void { keypressTimings = { spacing: { first: -1, @@ -505,8 +505,6 @@ export function resetKeypressTimings(carryover: boolean): void { keyDownData = {}; noCodeIndex = 0; - if (carryover) carryoverFirstKeypress(); - console.debug("Keypress timings reset"); } @@ -555,5 +553,5 @@ export function restart(): void { incorrect: 0, }; - resetKeypressTimings(false); + resetKeypressTimings(); } diff --git a/frontend/src/ts/test/test-logic.ts b/frontend/src/ts/test/test-logic.ts index 8d0ecd95d48e..4fc8fac60eab 100644 --- a/frontend/src/ts/test/test-logic.ts +++ b/frontend/src/ts/test/test-logic.ts @@ -145,7 +145,7 @@ export function startTest(now: number): boolean { TestState.setActive(true); Replay.startReplayRecording(); Replay.replayGetWordsList(TestWords.words.list); - TestInput.resetKeypressTimings(true); + TestInput.carryoverFirstKeypress(); Time.set(0); TestTimer.clear();