Skip to content

Commit

Permalink
Fix Account name validation
Browse files Browse the repository at this point in the history
  • Loading branch information
serg-plusplus committed Jun 11, 2021
1 parent 8da8f9d commit 705975c
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/app/pages/CreateAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const CreateAccount: FC = () => {
const { createAccount } = useTempleClient();
const allAccounts = useAllAccounts();
const setAccountPkh = useSetAccountPkh();
const formAnalytics = useFormAnalytics('CreateAccount');
const formAnalytics = useFormAnalytics("CreateAccount");

const allHDOrImported = useMemo(
() =>
Expand All @@ -51,14 +51,8 @@ const CreateAccount: FC = () => {
prevAccLengthRef.current = accLength;
}, [allAccounts, setAccountPkh]);

const {
register,
handleSubmit,
errors,
setError,
clearError,
formState,
} = useForm<FormData>({ defaultValues: { name: defaultName } });
const { register, handleSubmit, errors, setError, clearError, formState } =
useForm<FormData>({ defaultValues: { name: defaultName } });
const submitting = formState.isSubmitting;

const onSubmit = useCallback(
Expand Down Expand Up @@ -101,7 +95,7 @@ const CreateAccount: FC = () => {
<FormField
ref={register({
pattern: {
value: /^[a-zA-Z0-9 _-]{0,16}$/,
value: /^.{0,16}$/,
message: t("accountNameInputTitle"),
},
})}
Expand Down

0 comments on commit 705975c

Please sign in to comment.