From 4826cb84875a3aadeaae1e01eac0baef3dc16fad Mon Sep 17 00:00:00 2001 From: LASER-Yi Date: Thu, 22 Sep 2022 19:46:03 +0800 Subject: [PATCH] Fix validation issues of the language profile editor --- frontend/src/components/forms/ProfileEditForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/forms/ProfileEditForm.tsx b/frontend/src/components/forms/ProfileEditForm.tsx index c9503c11a..19ae1cd3f 100644 --- a/frontend/src/components/forms/ProfileEditForm.tsx +++ b/frontend/src/components/forms/ProfileEditForm.tsx @@ -49,7 +49,7 @@ const ProfileEditForm: FunctionComponent = ({ const form = useForm({ initialValues: profile, validate: { - name: (value) => value.length > 0, + name: (value) => (value.length > 0 ? null : "Must have a name"), items: (value) => value.length > 0 ? null : "Must contain at lease 1 language", },