mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-10 09:25:16 +08:00
ignore keydowns if tribe test is not active
This commit is contained in:
parent
cbf5778c4e
commit
42ee139690
1 changed files with 10 additions and 0 deletions
|
|
@ -23,6 +23,7 @@ import {
|
|||
getActiveFunboxesWithFunction,
|
||||
getActiveFunboxNames,
|
||||
} from "../../test/funbox/list";
|
||||
import * as TribeState from "../../tribe/tribe-state";
|
||||
|
||||
export async function handleTab(e: KeyboardEvent, now: number): Promise<void> {
|
||||
if (Config.quickRestart === "tab") {
|
||||
|
|
@ -144,6 +145,15 @@ async function handleFunboxes(
|
|||
}
|
||||
|
||||
export async function onKeydown(event: KeyboardEvent): Promise<void> {
|
||||
if (
|
||||
TribeState.getRoom() !== undefined &&
|
||||
TribeState.getState() >= 10 &&
|
||||
TribeState.getState() < 12
|
||||
) {
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
const now = performance.now();
|
||||
TestInput.recordKeydownTime(now, event);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue