mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-18 23:04:30 +08:00
fix(typig test): blind mode not highlighting missed characters as correct
(turns out that "old unused code" was actually quite important)
This commit is contained in:
parent
28a397ecf2
commit
4e46f6bc9f
2 changed files with 14 additions and 3 deletions
|
|
@ -267,8 +267,14 @@ async function handleSpace(): Promise<void> {
|
|||
return;
|
||||
}
|
||||
PaceCaret.handleSpace(false, currentWord);
|
||||
if (Config.blindMode) {
|
||||
if (Config.highlightMode !== "off") {
|
||||
TestUI.highlightAllLettersAsCorrect(TestUI.currentWordElementIndex);
|
||||
}
|
||||
} else {
|
||||
TestUI.highlightBadWord(TestUI.currentWordElementIndex);
|
||||
}
|
||||
TestInput.input.pushHistory();
|
||||
TestUI.highlightBadWord(TestUI.currentWordElementIndex, !Config.blindMode);
|
||||
TestWords.words.increaseCurrentIndex();
|
||||
Funbox.toggleScript(TestWords.words.getCurrent());
|
||||
TestInput.incrementKeypressCount();
|
||||
|
|
|
|||
|
|
@ -1408,11 +1408,16 @@ export async function applyBurstHeatmap(): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
export function highlightBadWord(index: number, showError: boolean): void {
|
||||
if (!showError) return;
|
||||
export function highlightBadWord(index: number): void {
|
||||
$($("#words .word")[index] as HTMLElement).addClass("error");
|
||||
}
|
||||
|
||||
export function highlightAllLettersAsCorrect(wordIndex: number): void {
|
||||
$($("#words .word")[wordIndex] as HTMLElement)
|
||||
.find("letter")
|
||||
.addClass("correct");
|
||||
}
|
||||
|
||||
export function highlightMode(mode?: SharedTypes.Config.HighlightMode): void {
|
||||
const existing =
|
||||
$("#words")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue