diff --git a/src/renderer/components/Connect/LoginModal.tsx b/src/renderer/components/Connect/LoginModal.tsx index d34602fad4165e0678305f0d0bb43aa0cffce374..26d33ee4da612be9cbe2006966f03e92df9a85cb 100644 --- a/src/renderer/components/Connect/LoginModal.tsx +++ b/src/renderer/components/Connect/LoginModal.tsx @@ -160,8 +160,8 @@ export default function LoginModal({ onSubmit={(event: React.FormEvent<HTMLFormElement>) => { event.preventDefault(); - const server = event.currentTarget.elements[0].value; - const port = event.currentTarget.elements[1].value; + const server = event.currentTarget.elements[0].value.trim().replace(/\/+$/, ''); + const port = event.currentTarget.elements[1].value.replace(/[\s]+/g, ''); // eslint-disable-next-line prefer-template const fullServer = 'http://' + server + ':' + port + '/'; @@ -177,7 +177,7 @@ export default function LoginModal({ <FormLabel>Server URL</FormLabel> <Input autoFocus required placeholder="192.168.1.100" /> <FormHelperText> - Do not include http:// in the URL or a / at the end + Do not include http:// in the URL. </FormHelperText> </FormControl> <FormControl>