Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/renderer/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.


if (validateURL(event.target.value)) {
setCurrentURL(eventValue);

if (validateURL(eventValue)) {
setURLValid(true);
onValidURL(event.target.value);
onValidURL(eventValue);
} else {
setURLValid(false);
}
Expand Down