Skip to content

Commit a070911

Browse files
committed
chore: remove test code, disable debounce on login
also increases default debounce
1 parent 5fcf964 commit a070911

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

frontend/src/ts/commandline/commandline-metadata.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,9 +582,6 @@ export const commandlineConfigMetadata: CommandlineConfigMetadataObject = {
582582
fontSize: {
583583
input: {
584584
inputValueConvert: Number,
585-
validation: {
586-
isValid: async (number: number) => number < 100,
587-
},
588585
},
589586
},
590587
fontFamily: {

frontend/src/ts/elements/input-validation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function debounceIfNeeded<T extends (...args: any[]) => any>(
4242
delay: number,
4343
callback: T
4444
): T | debounce<T> {
45-
if (delay === undefined || delay <= 0) {
45+
if (delay <= 0) {
4646
return callback;
4747
}
4848
return debounce(delay, callback);
@@ -64,7 +64,7 @@ export function createInputEventHandler<T>(
6464
let callIsValid =
6565
validation.isValid !== undefined
6666
? debounceIfNeeded(
67-
validation.debounceDelay ?? 100,
67+
validation.debounceDelay ?? 250,
6868
async (
6969
originalInput: HTMLInputElement,
7070
currentValue: string,

frontend/src/ts/pages/login.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ validateWithIndicator(emailInputEl, {
105105
}
106106
return true;
107107
},
108-
debounceDelay: 10,
108+
debounceDelay: 0,
109109
callback: (result) => {
110110
if (result.status === "success") {
111111
//re-validate the verify email
@@ -123,7 +123,7 @@ validateWithIndicator(emailVerifyInputEl, {
123123
? true
124124
: "verify email not matching email";
125125
},
126-
debounceDelay: 10,
126+
debounceDelay: 0,
127127
callback: (result) => {
128128
registerForm.email =
129129
result.status === "success" ? emailInputEl.value : undefined;
@@ -148,7 +148,7 @@ validateWithIndicator(passwordInputEl, {
148148
}
149149
return true;
150150
},
151-
debounceDelay: 10,
151+
debounceDelay: 0,
152152
callback: (result) => {
153153
if (result.status === "success") {
154154
//re-validate the verify password
@@ -166,7 +166,7 @@ validateWithIndicator(passwordVerifyInputEl, {
166166
? true
167167
: "verify password not matching password";
168168
},
169-
debounceDelay: 10,
169+
debounceDelay: 0,
170170
callback: (result) => {
171171
registerForm.password =
172172
result.status === "success" ? passwordInputEl.value : undefined;

0 commit comments

Comments
 (0)