diff --git a/components/domains/AddDomain.tsx b/components/domains/AddDomain.tsx index 1de36ef..8ae3b9f 100644 --- a/components/domains/AddDomain.tsx +++ b/components/domains/AddDomain.tsx @@ -13,10 +13,10 @@ const AddDomain = ({ closeModal }: AddDomainProps) => { const addDomain = () => { // console.log('ADD NEW DOMAIN', newDomain); - if (/^[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$/.test(newDomain)) { + if (/^[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$/.test(newDomain.trim())) { setNewDomainError(false); // TODO: Domain Action - addMutate(newDomain); + addMutate(newDomain.trim()); } else { setNewDomainError(true); }