Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix network-form ui #7137

Merged
merged 2 commits into from
Sep 10, 2019
Merged

Fix network-form ui #7137

merged 2 commits into from
Sep 10, 2019

Conversation

Sunghee2
Copy link
Contributor

스크린샷 2019-09-10 오전 10 53 23

When creating new network settings, Block Explorer URL is optional.
If I write a letter and then erase all letter on this form(Block Explorer URL), save button must be activated because there is no value.
But When I do this, the button is disabled, as shown in the picture.
So I solved this problem by adding checking the value of this form.

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

This solution seems pretty good, except that as a consequence it now means that a blank RPC URL would be allowed too (because it uses the same validateUrl helper function).

Maybe you could make a separate helper function for validating the blockExplorerUrl field. It looks like validateUrl never should have been used anyway - the error case assumes it's an RPC URL (e.g. see on line 221, it'd give the error invalidRPC even if it was an invalid Block Explorer URL)

@Sunghee2
Copy link
Contributor Author

Thanks you!
As you said, I created a new ValidateBlockExplorerUrl function.

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good!

It would have been better if we could refactor the common steps between the two validation functions, and we should use a better error than invalidRPC, but this is still better than it was before. We can make these other two improvements another time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants