mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-06 23:44:19 +08:00
fix: partially completed last words not being counted in custom timed mode
This commit is contained in:
parent
0ee4b2960a
commit
28c1cccd57
1 changed files with 6 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ import * as TestState from "./test-state";
|
|||
import * as Numbers from "@monkeytype/util/numbers";
|
||||
import { CompletedEvent, IncompleteTest } from "@monkeytype/schemas/results";
|
||||
import { isFunboxActiveWithProperty } from "./funbox/list";
|
||||
import * as CustomText from "./custom-text";
|
||||
|
||||
type CharCount = {
|
||||
spaces: number;
|
||||
|
|
@ -343,7 +344,11 @@ function countChars(): CharCount {
|
|||
}
|
||||
correctChars += toAdd.correct;
|
||||
incorrectChars += toAdd.incorrect;
|
||||
if (i === inputWords.length - 1 && Config.mode === "time") {
|
||||
if (
|
||||
i === inputWords.length - 1 &&
|
||||
(Config.mode === "time" ||
|
||||
(Config.mode === "custom" && CustomText.getLimit().mode === "time"))
|
||||
) {
|
||||
//last word - check if it was all correct - add to correct word chars
|
||||
if (toAdd.incorrect === 0) correctWordChars += toAdd.correct;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue