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 = () => {
|
const closeSettings = () => {
|
||||||
|
if (error) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setOpen(false);
|
setOpen(false);
|
||||||
|
|
||||||
setError(false);
|
setError(false);
|
||||||
|
@ -78,9 +82,9 @@ const EndpointDialog = ({ endpoint }: EndpointDialogProps) => {
|
||||||
/>
|
/>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={closeSettings}>Close</Button>
|
<Button
|
||||||
|
disabled={error}
|
||||||
<Button onClick={() => {
|
onClick={() => {
|
||||||
if (isValidEndpoint()) {
|
if (isValidEndpoint()) {
|
||||||
closeSettings();
|
closeSettings();
|
||||||
closeTheError();
|
closeTheError();
|
||||||
|
|
Loading…
Reference in a new issue