interface: hide invite if already joined

This commit is contained in:
Liam Fitzgerald 2021-12-08 15:24:32 -05:00
parent b8da026c5e
commit 0979b8fc39
2 changed files with 4 additions and 2 deletions

View File

@ -79,7 +79,9 @@ export default function Groups(props: Parameters<typeof Box>[0]) {
resourceAsPath(inv.resource)
) || []
);
const pending = _.union(invites, Object.keys(joining));
const pending = _.union(invites, Object.keys(joining)).filter(group => {
return !(group in (groupState?.groups || {})) && !(group in (associations.groups || {}))
});
return (
<>

View File

@ -109,7 +109,7 @@ export function SidebarList(props: {
s => Object.values(s.invites?.['graph'] || {})
.map(inv => {
return `/ship/~${inv.resource.ship}/${inv.resource.name}`
})
}).filter(group => !(group in groups))
);
const pending = [...pendingDms, ...Object.keys(pendingGroupChats), ...inviteGroupChats];
const unreads = useHarkState(s => s.unreads);