diff --git a/src/components/organization/users/EditUserRolesModal.tsx b/src/components/organization/users/EditUserRolesModal.tsx index e4be018ac..a7353557a 100644 --- a/src/components/organization/users/EditUserRolesModal.tsx +++ b/src/components/organization/users/EditUserRolesModal.tsx @@ -23,6 +23,9 @@ const EditUserRoleModal = (props: { openModal: boolean; user: User; setMessage: const [erroMsg, setErrMsg] = useState(null) + const [shouldRender, setShouldRender] = useState(true); + + const getRoles = async () => { const resRoles = await getOrganizationRoles() @@ -128,7 +131,7 @@ const EditUserRoleModal = (props: { openModal: boolean; user: User; setMessage: }) setRoles(updatesRoles) } - + setShouldRender(shouldRender); } return ( @@ -168,8 +171,8 @@ const EditUserRoleModal = (props: { openModal: boolean; user: User; setMessage: Roles * - { + { shouldRender && ( roles &&
{ @@ -189,7 +192,7 @@ const EditUserRoleModal = (props: { openModal: boolean; user: User; setMessage: )) }
- } + )}