mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-01 09:14:27 +08:00
returning if word is undefined
This commit is contained in:
parent
2abd0e69fe
commit
81afc92022
1 changed files with 4 additions and 3 deletions
|
@ -88,11 +88,12 @@ const debouncedEvent = debounce(250, async () => {
|
|||
if (Config.tapeMode !== "off") {
|
||||
TestUI.scrollTape();
|
||||
} else {
|
||||
const currentTop: number = Math.floor(
|
||||
const word =
|
||||
document.querySelectorAll<HTMLElement>("#words .word")[
|
||||
TestUI.currentWordElementIndex - 1
|
||||
].offsetTop
|
||||
);
|
||||
];
|
||||
if (!word) return;
|
||||
const currentTop: number = Math.floor(word.offsetTop);
|
||||
TestUI.lineJump(currentTop);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue