Don't let the user close the endpoint dialog window if the endpoint is an invalid URL
This commit is contained in:
parent
69a1de99e2
commit
42bbb67639
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue