impr(pace caret): only update pace caret on repeated tests if wpm was higher (toma-demagn) (#4798)

* Update pace-caret.ts

Changed the logic for lastTestWpm when repeating a test

* Update pace-caret.ts

Prettier reformat of file
This commit is contained in:
toma-demagn 2023-11-17 14:18:50 +01:00 committed by GitHub
parent 572dcd54d9
commit fbe835b0a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,7 +23,12 @@ export let settings: Settings | null = null;
let lastTestWpm = 0;
export function setLastTestWpm(wpm: number): void {
lastTestWpm = wpm;
if (
!TestState.isPaceRepeat ||
(TestState.isPaceRepeat && wpm > lastTestWpm)
) {
lastTestWpm = wpm;
}
}
function resetCaretPosition(): void {