Skip to content
This repository was archived by the owner on Dec 2, 2022. It is now read-only.

Commit c33fb25

Browse files
committed
Repository name validation
1 parent 2641c8d commit c33fb25

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ui/components/argit/newRepoForm.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ class NewRepoForm extends Component<NewRepoFormProps, NewRepoFormState> {
4848
console.log(this.checkIfExists(repo.name))
4949
if (repo.name.trim() === "") {
5050
errors.name = "Repository Name is required"
51+
} else if (/[A-Za-z0-9_.-]*/.test(repo.name)) {
52+
errors.name =
53+
"Repository name should only include alphanumeric characters, _, . or -"
5154
} else if (this.checkIfExists(repo.name)) {
5255
errors.name = "Repository Name already exists"
5356
} else {
@@ -100,9 +103,7 @@ class NewRepoForm extends Component<NewRepoFormProps, NewRepoFormState> {
100103
return
101104
}
102105

103-
// PST Fee handling
104-
105-
await arweave.transactions.post(tx) // Post transaction
106+
// await arweave.transactions.post(tx) // Post transaction
106107

107108
this.setState({ transactionLoading: false }) // Set loading status to false
108109
this.props.closeCreateRepoModal({})

0 commit comments

Comments
 (0)