Skip to content

Commit

Permalink
fix: default role selection makes the user invisible on the dashboard…
Browse files Browse the repository at this point in the history
… until the page is refreshed

Signed-off-by: MoulikaKulkarni <[email protected]>
  • Loading branch information
MoulikaKulkarni committed Sep 21, 2023
1 parent 8a97052 commit f94e192
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/organization/users/EditUserRolesModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ const EditUserRoleModal = (props: { openModal: boolean; user: User; setMessage:

const [erroMsg, setErrMsg] = useState<string | null>(null)

const [shouldRender, setShouldRender] = useState(true);


const getRoles = async () => {

const resRoles = await getOrganizationRoles()
Expand Down Expand Up @@ -128,7 +131,7 @@ const EditUserRoleModal = (props: { openModal: boolean; user: User; setMessage:
})
setRoles(updatesRoles)
}

setShouldRender(shouldRender);
}

return (
Expand Down Expand Up @@ -168,8 +171,8 @@ const EditUserRoleModal = (props: { openModal: boolean; user: User; setMessage:
Roles
<span className="text-red-500 text-xs">*</span>
</div>
{

{ shouldRender && (
roles && <div className="grid w-full grid-cols-1 gap-4 mt-0 mb-4 xl:grid-cols-2 2xl:grid-cols-2">

{
Expand All @@ -189,7 +192,7 @@ const EditUserRoleModal = (props: { openModal: boolean; user: User; setMessage:
))
}
</div>
}
)}


</div>
Expand Down

0 comments on commit f94e192

Please sign in to comment.