Skip to content

Commit

Permalink
fix: removes empty spaces when adding domain.
Browse files Browse the repository at this point in the history
  • Loading branch information
towfiqi committed Dec 2, 2022
1 parent d01b65d commit a11b0f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/domains/AddDomain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit a11b0f2

Please sign in to comment.