Skip to content

Commit

Permalink
fix: loading stops prematurely on fullscreen transition
Browse files Browse the repository at this point in the history
loading stops executing or presenting before moving to the second step
  • Loading branch information
JE1999 committed May 2, 2024
1 parent 90d8872 commit 3047d31
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/[lang]/identification/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,24 +81,25 @@ export function Form() {
const { isHuman } = await validateRecaptcha(reCaptchaToken);

if (!isHuman) {
setLoading(false);
return AlertError(intl.errors.recaptcha.validation);
}

const { exists } = await findIamCitizen(cedula);

if (exists) {
setLoading(false);
return AlertError(intl.errors.cedula.exists);
}

const citizen = await findCitizen(cedula);
await setCookie('citizen', citizen);
router.push('liveness');
setLoading(false);
} catch (err: any) {
Sentry.captureMessage(err.message || err, 'error');

return AlertError(intl.errors.cedula.invalid);
} finally {
setLoading(false);
return AlertError(intl.errors.cedula.invalid);
}
});

Expand Down

0 comments on commit 3047d31

Please sign in to comment.