diff --git a/src/app/(simulation)/(large-layout)/amis/creer/votre-groupe/_components/NameForm.tsx b/src/app/(simulation)/(large-layout)/amis/creer/votre-groupe/_components/NameForm.tsx index dac3fc186..04e4d2383 100644 --- a/src/app/(simulation)/(large-layout)/amis/creer/votre-groupe/_components/NameForm.tsx +++ b/src/app/(simulation)/(large-layout)/amis/creer/votre-groupe/_components/NameForm.tsx @@ -32,6 +32,8 @@ export default function NameForm() { formState: { errors }, } = useReactHookForm() + const [error, setError] = useState('') + const { user } = useUser() const searchParams = useSearchParams() @@ -69,6 +71,10 @@ export default function NameForm() { ]) async function onSubmit({ name, emoji }: Inputs) { + if (error) { + setError('') + } + try { const administratorEmail = formatEmail( searchParams.get('administratorEmail') @@ -96,6 +102,11 @@ export default function NameForm() { setShouldNavigate(group.id) } catch (e) { + setError( + t( + 'Une erreur est survenue. Si le problème persiste, veuillez contacter notre support.' + ) + ) captureException(e) } } @@ -126,6 +137,8 @@ export default function NameForm() { error={errors.emoji?.message} /> + {error &&

{error}

} +