calculating burst based on input length, not word

This commit is contained in:
Miodec 2022-03-01 18:44:12 +01:00
parent 7c21991cd9
commit 2735673d95

View file

@ -280,13 +280,9 @@ export function setLastSecondNotRound(): void {
export function calculateBurst(): number {
const timeToWrite = (performance.now() - TestInput.currentBurstStart) / 1000;
let wordLength;
if (Config.mode === "zen") {
wordLength = TestInput.input.current.length;
if (wordLength == 0) {
wordLength = TestInput.input.getHistoryLast().length;
}
} else {
wordLength = TestWords.words.getCurrent().length;
wordLength = TestInput.input.current.length;
if (Config.mode === "zen" && wordLength == 0) {
wordLength = TestInput.input.getHistoryLast().length;
}
const speed = Misc.roundTo2((wordLength * (60 / timeToWrite)) / 5);
return Math.round(speed);