Skip to content

Commit

Permalink
chore: validate stellar account in register input
Browse files Browse the repository at this point in the history
  • Loading branch information
0xExp-po committed Sep 20, 2024
1 parent d3edca9 commit ab56ad3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dapp/src/components/RegisterProject.astro
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ import ModalInput from "./utils/ModalInput.astro";
if (!maintainers.value.trim()) {
isValid = false;
showError(maintainers, maintainers_error, "Maintainers cannot be empty");
} else {
const addressList = maintainers.value.split(',').map(addr => addr.trim());
const invalidAddresses = addressList.filter(addr => !addr.startsWith('G') || addr.length !== 56);
if (invalidAddresses.length > 0) {
isValid = false;
showError(maintainers, maintainers_error, "Invalid maintainer address(es). Each address should start with 'G' and be 56 characters long.");
}
}

// Check GitHub URL
Expand Down

0 comments on commit ab56ad3

Please sign in to comment.