mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-14 17:41:33 +03:00
Participants: fix count
This commit is contained in:
parent
ede3b53c60
commit
db811cf1bd
@ -66,9 +66,8 @@ function getParticipants(cs: Contacts, group: Group) {
|
|||||||
}))
|
}))
|
||||||
)(cs);
|
)(cs);
|
||||||
const members: Participant[] = _.map(
|
const members: Participant[] = _.map(
|
||||||
Array.from(group.members)
|
Array.from(group.members),
|
||||||
.filter(e => group?.policy?.invite?.pending ? !group.policy.invite.pending.has(e) : true), m =>
|
s => contacts[s] ?? emptyContact(s, false)
|
||||||
emptyContact(m, false)
|
|
||||||
);
|
);
|
||||||
const allMembers = _.unionBy(contacts, members, 'patp');
|
const allMembers = _.unionBy(contacts, members, 'patp');
|
||||||
const pending: Participant[] =
|
const pending: Participant[] =
|
||||||
@ -78,10 +77,11 @@ function getParticipants(cs: Contacts, group: Group) {
|
|||||||
)
|
)
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
|
const incPending = _.unionBy(allMembers, pending, 'patp');
|
||||||
return [
|
return [
|
||||||
_.unionBy(allMembers, pending, 'patp'),
|
incPending,
|
||||||
pending.length,
|
incPending.length - group.members.size,
|
||||||
allMembers.length
|
group.members.size
|
||||||
] as const;
|
] as const;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user