From bda8b29d26cd5ff0176a8027d7629f63eb4db654 Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Wed, 7 Oct 2020 15:26:53 -0400 Subject: [PATCH] launch: accept group invites correctly --- .../src/views/apps/launch/components/Groups.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/interface/src/views/apps/launch/components/Groups.tsx b/pkg/interface/src/views/apps/launch/components/Groups.tsx index ce2e25c599..a4f3f574d5 100644 --- a/pkg/interface/src/views/apps/launch/components/Groups.tsx +++ b/pkg/interface/src/views/apps/launch/components/Groups.tsx @@ -50,6 +50,14 @@ export default function Groups(props: GroupsProps & Parameters[0]) { .sort(sortGroupsAlph) .sort(sortGroupsRecent(recentGroups)) + const acceptInvite = (invite) => { + const [, , ship, name] = invite.path.split('/'); + const resource = { ship, name }; + return api.contacts.join(resource).then(() => { + api.invite.accept('/contacts', getKeyByValue(invites['/contacts'], invite)); + }); + }; + return ( [0]) { {invite.path.slice(6)} api.invite.accept('/contacts', getKeyByValue(invites['/contacts'], invite))} + onClick={() => acceptInvite(invite)} color='blue' mr='2' cursor='pointer'>