mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-09 13:44:29 +08:00
refactor: not running test dependent functions if active page is not test
This commit is contained in:
parent
897cfde4eb
commit
3c32eee9a5
1 changed files with 3 additions and 0 deletions
|
|
@ -20,6 +20,7 @@ import { skipXpBreakdown } from "../elements/account-button";
|
|||
import * as FunboxList from "./funbox/funbox-list";
|
||||
import { debounce } from "throttle-debounce";
|
||||
import * as ResultWordHighlight from "../elements/result-word-highlight";
|
||||
import * as ActivePage from "../states/active-page";
|
||||
|
||||
const debouncedZipfCheck = debounce(250, () => {
|
||||
Misc.checkIfLanguageSupportsZipf(Config.language).then((supports) => {
|
||||
|
|
@ -226,6 +227,7 @@ function shouldUpdateWordsInputPosition(): boolean {
|
|||
}
|
||||
|
||||
export function updateWordsInputPosition(initial = false): void {
|
||||
if (ActivePage.get() !== "test") return;
|
||||
if (Config.tapeMode !== "off" && !initial) return;
|
||||
const el = document.querySelector("#wordsInput") as HTMLElement;
|
||||
const activeWord = document.querySelector(
|
||||
|
|
@ -282,6 +284,7 @@ export function updateWordsInputPosition(initial = false): void {
|
|||
}
|
||||
|
||||
function updateWordsHeight(force = false): void {
|
||||
if (ActivePage.get() !== "test") return;
|
||||
if (!force && Config.mode !== "custom") return;
|
||||
$("#wordsWrapper").removeClass("hidden");
|
||||
const wordHeight = <number>(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue