mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-17 02:56:16 +08:00
chore: remove test code, disable debounce on login
also increases default debounce
This commit is contained in:
parent
5fcf964ebc
commit
a070911fdd
3 changed files with 6 additions and 9 deletions
|
@ -582,9 +582,6 @@ export const commandlineConfigMetadata: CommandlineConfigMetadataObject = {
|
|||
fontSize: {
|
||||
input: {
|
||||
inputValueConvert: Number,
|
||||
validation: {
|
||||
isValid: async (number: number) => number < 100,
|
||||
},
|
||||
},
|
||||
},
|
||||
fontFamily: {
|
||||
|
|
|
@ -42,7 +42,7 @@ export function debounceIfNeeded<T extends (...args: any[]) => any>(
|
|||
delay: number,
|
||||
callback: T
|
||||
): T | debounce<T> {
|
||||
if (delay === undefined || delay <= 0) {
|
||||
if (delay <= 0) {
|
||||
return callback;
|
||||
}
|
||||
return debounce(delay, callback);
|
||||
|
@ -64,7 +64,7 @@ export function createInputEventHandler<T>(
|
|||
let callIsValid =
|
||||
validation.isValid !== undefined
|
||||
? debounceIfNeeded(
|
||||
validation.debounceDelay ?? 100,
|
||||
validation.debounceDelay ?? 250,
|
||||
async (
|
||||
originalInput: HTMLInputElement,
|
||||
currentValue: string,
|
||||
|
|
|
@ -105,7 +105,7 @@ validateWithIndicator(emailInputEl, {
|
|||
}
|
||||
return true;
|
||||
},
|
||||
debounceDelay: 10,
|
||||
debounceDelay: 0,
|
||||
callback: (result) => {
|
||||
if (result.status === "success") {
|
||||
//re-validate the verify email
|
||||
|
@ -123,7 +123,7 @@ validateWithIndicator(emailVerifyInputEl, {
|
|||
? true
|
||||
: "verify email not matching email";
|
||||
},
|
||||
debounceDelay: 10,
|
||||
debounceDelay: 0,
|
||||
callback: (result) => {
|
||||
registerForm.email =
|
||||
result.status === "success" ? emailInputEl.value : undefined;
|
||||
|
@ -148,7 +148,7 @@ validateWithIndicator(passwordInputEl, {
|
|||
}
|
||||
return true;
|
||||
},
|
||||
debounceDelay: 10,
|
||||
debounceDelay: 0,
|
||||
callback: (result) => {
|
||||
if (result.status === "success") {
|
||||
//re-validate the verify password
|
||||
|
@ -166,7 +166,7 @@ validateWithIndicator(passwordVerifyInputEl, {
|
|||
? true
|
||||
: "verify password not matching password";
|
||||
},
|
||||
debounceDelay: 10,
|
||||
debounceDelay: 0,
|
||||
callback: (result) => {
|
||||
registerForm.password =
|
||||
result.status === "success" ? passwordInputEl.value : undefined;
|
||||
|
|
Loading…
Add table
Reference in a new issue