diff --git a/src/components/Settings/EditOidcModal/index.tsx b/src/components/Settings/EditOidcModal/index.tsx index 346da6f8..427dddc7 100644 --- a/src/components/Settings/EditOidcModal/index.tsx +++ b/src/components/Settings/EditOidcModal/index.tsx @@ -58,15 +58,16 @@ interface EditOidcModalProps { onOk: () => void; } -function SlugField(props: FieldAttributes) { +function SlugField(props: FieldAttributes & { readOnly?: boolean }) { const { values: { name }, setFieldValue, } = useFormikContext>(); useEffect(() => { - setFieldValue(props.name, name?.toLowerCase().replace(/\s/g, '-')); - }, [props.name, name, setFieldValue]); + if (!props.readOnly) + setFieldValue(props.name, name?.toLowerCase().replace(/\s/g, '-')); + }, [props.name, props.readOnly, name, setFieldValue]); return ; }