Update restriction to change the role of other Owners

pull/2657/head^2
Julián David Sánchez Gallego 2022-03-15 13:56:11 -05:00 committed by Omar López
parent 68e08f13a1
commit 257481bad5
1 changed files with 3 additions and 2 deletions

View File

@ -52,7 +52,7 @@ export default function MemberListItem(props: Props) {
const ownersInTeam = () => {
const { members } = props.team;
const owners = members.filter((member) => member["role"] === MembershipRole.OWNER);
const owners = members.filter((member) => member["role"] === MembershipRole.OWNER && member["accepted"]);
return owners.length;
};
@ -138,7 +138,8 @@ export default function MemberListItem(props: Props) {
<DropdownMenuSeparator className="h-px bg-gray-200" />
{((props.team.membership.role === MembershipRole.OWNER &&
(props.member.role !== MembershipRole.OWNER ||
(ownersInTeam() > 1 && props.member.id === currentUser))) ||
ownersInTeam() > 1 ||
props.member.id !== currentUser)) ||
(props.team.membership.role === MembershipRole.ADMIN &&
props.member.role !== MembershipRole.OWNER)) && (
<>