diff --git a/apps/web/components/team/MemberListItem.tsx b/apps/web/components/team/MemberListItem.tsx index 401dc9620f..9cb4f524e1 100644 --- a/apps/web/components/team/MemberListItem.tsx +++ b/apps/web/components/team/MemberListItem.tsx @@ -52,7 +52,7 @@ export default function MemberListItem(props: Props) { const ownersInTeam = () => { const { members } = props.team; - const owners = members.filter((member) => member["role"] === "OWNER"); + const owners = members.filter((member) => member["role"] === MembershipRole.OWNER); return owners.length; }; @@ -137,8 +137,10 @@ export default function MemberListItem(props: Props) { {((props.team.membership.role === MembershipRole.OWNER && - (props.member.role !== "OWNER" || (ownersInTeam() > 1 && props.member.id === currentUser))) || - (props.team.membership.role === MembershipRole.ADMIN && props.member.role !== "OWNER")) && ( + (props.member.role !== MembershipRole.OWNER || + (ownersInTeam() > 1 && props.member.id === currentUser))) || + (props.team.membership.role === MembershipRole.ADMIN && + props.member.role !== MembershipRole.OWNER)) && ( <>