fix: correct sub-org identity check

This commit is contained in:
Scott Wilson
2025-12-12 09:36:19 -08:00
parent 9b9afd6cef
commit ba64077132
@@ -64,7 +64,7 @@ const Page = () => {
select: (el) => el.identityId as string select: (el) => el.identityId as string
}); });
const { currentProject, projectId } = useProject(); const { currentProject, projectId } = useProject();
const { currentOrg } = useOrganization(); const { currentOrg, isSubOrganization } = useOrganization();
const { data: identityMembershipDetails, isPending: isMembershipDetailsLoading } = const { data: identityMembershipDetails, isPending: isMembershipDetailsLoading } =
useGetProjectIdentityMembershipV2(projectId, identityId); useGetProjectIdentityMembershipV2(projectId, identityId);
@@ -167,7 +167,9 @@ const Page = () => {
const isOrgIdentity = !isProjectIdentity; const isOrgIdentity = !isProjectIdentity;
const isSubOrgIdentity = const isSubOrgIdentity =
isOrgIdentity && currentOrg.rootOrgId !== identityMembershipDetails?.identity.orgId; isOrgIdentity &&
isSubOrganization &&
currentOrg.rootOrgId !== identityMembershipDetails?.identity.orgId;
return ( return (
<div className="mx-auto flex max-w-8xl flex-col"> <div className="mx-auto flex max-w-8xl flex-col">