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

Trim Server URL #375

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

stevebell117
Copy link

@stevebell117 stevebell117 commented Dec 14, 2020

Whenever a Server URL is copy/pasted (from Discord, for example), it will sometimes add a space to the beginning or end of the URL and fail the URL Validation. This change trims the white space at the beginning and end of the string before verifying the URL.

@@ -145,11 +145,13 @@ function URLInput({ initialURL, onValidURL }: URLInputProps) {
}, [initialURL]);

function onChange(event: React.ChangeEvent<HTMLInputElement>) {
setCurrentURL(event.target.value);
let eventValue = event.target.value.trim();

Choose a reason for hiding this comment

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

since eventValue won't change, I think it should be a const instead of let.

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