Don't let the user close the endpoint dialog window if the endpoint is an invalid URL

This commit is contained in:
powermaker450 2024-09-09 19:00:27 -04:00
parent 69a1de99e2
commit 42bbb67639

View file

@ -24,6 +24,10 @@ const EndpointDialog = ({ endpoint }: EndpointDialogProps) => {
};
const closeSettings = () => {
if (error) {
return;
}
setOpen(false);
setError(false);
@ -78,9 +82,9 @@ const EndpointDialog = ({ endpoint }: EndpointDialogProps) => {
/>
</DialogContent>
<DialogActions>
<Button onClick={closeSettings}>Close</Button>
<Button onClick={() => {
<Button
disabled={error}
onClick={() => {
if (isValidEndpoint()) {
closeSettings();
closeTheError();