Participants: kick pending contacts

Fixes urbit/landscape#269
This commit is contained in:
Liam Fitzgerald 2021-03-08 14:02:32 +10:00
parent ed8ec1085a
commit 35a1fe12bc
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB

View File

@ -286,8 +286,15 @@ function Participant(props: {
const onKick = useCallback(async () => {
const resource = resourceFromPath(association.group);
await api.groups.remove(resource, [`~${contact.patp}`]);
}, [api, association]);
if(contact.pending) {
await api.groups.changePolicy(
resource,
{ invite: { removeInvites: [`~${contact.patp}`] } }
);
} else {
await api.groups.remove(resource, [`~${contact.patp}`]);
}
}, [api, contact, association]);
const avatar =
contact?.avatar !== null && !hideAvatars ? (