diff --git a/src/components/download-dialog/DownloadDialog.tsx b/src/components/download-dialog/DownloadDialog.tsx index 9c207d0e45..0e22a9e49c 100644 --- a/src/components/download-dialog/DownloadDialog.tsx +++ b/src/components/download-dialog/DownloadDialog.tsx @@ -4,6 +4,7 @@ import { AlertVariant, Form, FormGroup, + ModalVariant, Select, SelectOption, SelectVariant, @@ -66,13 +67,19 @@ export const DownloadDialog = ({ const [openType, setOpenType] = useState(false); useEffect(() => { + let isMounted = true; (async () => { const response = await httpClient.doGet( `/admin/realms/${realm}/clients/${id}/installation/providers/${selected}` ); - setSnippet(await response.text()); + if (isMounted) { + setSnippet(await response.text()); + } })(); - }, [selected, snippet]); + return () => { + isMounted = false; + }; + }, [selected]); return (