mirror of
https://github.com/immich-app/immich.git
synced 2025-06-03 19:19:23 +02:00
pr feedback
This commit is contained in:
parent
fa22c345be
commit
b2e804714f
2 changed files with 4 additions and 9 deletions
web/src/lib/components/user-settings-page
|
@ -18,9 +18,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
const focusNext = (index: number) => {
|
const focusNext = (index: number) => {
|
||||||
if (index < pinLength - 1) {
|
pincodeInputElements[Math.min(index + 1, pinLength - 1)]?.focus();
|
||||||
pincodeInputElements[index + 1]?.focus();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const focusPrev = (index: number) => {
|
const focusPrev = (index: number) => {
|
||||||
|
@ -37,7 +35,7 @@
|
||||||
currentPinValue = value.slice(0, 1);
|
currentPinValue = value.slice(0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!/^\d*$/.test(value)) {
|
if (Number.isNaN(Number(value))) {
|
||||||
pinValues[index] = '';
|
pinValues[index] = '';
|
||||||
target.value = '';
|
target.value = '';
|
||||||
return;
|
return;
|
||||||
|
@ -82,7 +80,7 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
if (!/^\d$/.test(event.key)) {
|
if (Number.isNaN(Number(event.key))) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -34,10 +34,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
const canSubmit = $derived(
|
const canSubmit = $derived(
|
||||||
(hasPincode ? currentPincode.length === 6 : true) &&
|
(hasPincode ? currentPincode.length === 6 : true) && confirmPincode.length === 6 && newPincode === confirmPincode,
|
||||||
newPincode.length === 6 &&
|
|
||||||
confirmPincode.length === 6 &&
|
|
||||||
newPincode === confirmPincode,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleCreatePincode = async () => {
|
const handleCreatePincode = async () => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue