Skip to content

Commit

Permalink
fix validate custom network name field on form submission
Browse files Browse the repository at this point in the history
  • Loading branch information
Nithishvb committed Jan 8, 2024
1 parent d4c99d5 commit d1c3fa6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/features/add-network/add-network.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ export function AddNetwork() {
onSubmit={async () => {
const { name, stacksUrl, bitcoinUrl, key } = formikProps.values;

if (!name) {
setError('Enter a name');
return;
}

if (!isValidUrl(stacksUrl)) {
setError('Enter a valid Stacks API URL');
return;
Expand Down

0 comments on commit d1c3fa6

Please sign in to comment.