fix some errors cause app crash

This commit is contained in:
Ren Amamiya
2023-08-19 08:56:19 +07:00
parent c85502e427
commit eda18f8c34
14 changed files with 265 additions and 253 deletions

View File

@@ -76,6 +76,9 @@ export function OnboardStep3Screen() {
}
}
// update last login
await db.updateLastLogin();
clearStep();
navigate('/', { replace: true });
} catch (e) {

View File

@@ -46,14 +46,6 @@ export function UnlockScreen() {
} = useForm<FormValues>({ resolver });
const onSubmit = async (data: { [x: string]: string }) => {
if (data.password.length < 3) {
setError('password', {
type: 'custom',
message: 'Password is required and must be greater than 3',
});
return;
}
try {
setLoading(true);
@@ -89,7 +81,7 @@ export function UnlockScreen() {
<div className="flex flex-col gap-1">
<div className="relative">
<input
{...register('password', { required: true })}
{...register('password', { required: true, minLength: 4 })}
type={'password'}
placeholder="Password"
className="relative h-12 w-full rounded-lg bg-white/10 py-1 text-center text-white !outline-none placeholder:text-white/50"