From 755a7eb5375e498815399164d4dd44cd0ce33221 Mon Sep 17 00:00:00 2001 From: Leonabcd123 <156839416+Leonabcd123@users.noreply.github.com> Date: Mon, 23 Mar 2026 18:13:07 +0200 Subject: [PATCH 1/2] Split two functions --- frontend/src/ts/test/test-input.ts | 8 +++----- frontend/src/ts/test/test-logic.ts | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/frontend/src/ts/test/test-input.ts b/frontend/src/ts/test/test-input.ts index 1dfa8cf72d82..f8084b0dccea 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 { +export 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 22eaf83e5f20..59d36584e6a8 100644 --- a/frontend/src/ts/test/test-logic.ts +++ b/frontend/src/ts/test/test-logic.ts @@ -139,7 +139,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(); From 0a1b959482d993d7eada511dfbf017d78314304d Mon Sep 17 00:00:00 2001 From: Leonabcd123 <156839416+Leonabcd123@users.noreply.github.com> Date: Mon, 23 Mar 2026 18:27:00 +0200 Subject: [PATCH 2/2] Don't export --- frontend/src/ts/test/test-input.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/ts/test/test-input.ts b/frontend/src/ts/test/test-input.ts index f8084b0dccea..c58e088a75d9 100644 --- a/frontend/src/ts/test/test-input.ts +++ b/frontend/src/ts/test/test-input.ts @@ -487,7 +487,7 @@ export function carryoverFirstKeypress(): void { } } -export function resetKeypressTimings(): void { +function resetKeypressTimings(): void { keypressTimings = { spacing: { first: -1,