Skip to content

Commit 755a7eb

Browse files
committed
Split two functions
1 parent 12fbad3 commit 755a7eb

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

frontend/src/ts/test/test-input.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ function updateOverlap(now: number): void {
452452
}
453453
}
454454

455-
function carryoverFirstKeypress(): void {
455+
export function carryoverFirstKeypress(): void {
456456
// Because keydown triggers before input, we need to grab the first keypress data here and carry it over
457457

458458
// Take the key with the largest index
@@ -487,7 +487,7 @@ function carryoverFirstKeypress(): void {
487487
}
488488
}
489489

490-
export function resetKeypressTimings(carryover: boolean): void {
490+
export function resetKeypressTimings(): void {
491491
keypressTimings = {
492492
spacing: {
493493
first: -1,
@@ -505,8 +505,6 @@ export function resetKeypressTimings(carryover: boolean): void {
505505
keyDownData = {};
506506
noCodeIndex = 0;
507507

508-
if (carryover) carryoverFirstKeypress();
509-
510508
console.debug("Keypress timings reset");
511509
}
512510

@@ -555,5 +553,5 @@ export function restart(): void {
555553
incorrect: 0,
556554
};
557555

558-
resetKeypressTimings(false);
556+
resetKeypressTimings();
559557
}

frontend/src/ts/test/test-logic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export function startTest(now: number): boolean {
139139
TestState.setActive(true);
140140
Replay.startReplayRecording();
141141
Replay.replayGetWordsList(TestWords.words.list);
142-
TestInput.resetKeypressTimings(true);
142+
TestInput.carryoverFirstKeypress();
143143
Time.set(0);
144144
TestTimer.clear();
145145

0 commit comments

Comments
 (0)