saving replay event earlier

This commit is contained in:
Miodec 2022-03-02 23:16:56 +01:00
parent 9d9e879ebe
commit 5a018f65c5

View file

@ -475,6 +475,11 @@ function handleChar(char: string, charIndex: number): void {
TestInput.input.current = resultingWord;
}
Replay.addReplayEvent(
thisCharCorrect ? "correctLetter" : "incorrectLetter",
char
);
if (!thisCharCorrect && Config.difficulty == "master") {
TestInput.input.pushHistory();
TestInput.corrected.pushHistory();
@ -486,11 +491,6 @@ function handleChar(char: string, charIndex: number): void {
return;
}
Replay.addReplayEvent(
thisCharCorrect ? "correctLetter" : "incorrectLetter",
char
);
//update the active word top, but only once
if (
TestInput.input.current.length === 1 &&