From 0a71df076f6cab1b0802a03f135bdc0e6513ca42 Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Fri, 12 Mar 2021 12:03:02 +1000 Subject: [PATCH] Participants: fix display of nonmembers Fixes urbit/landscape #552 --- .../landscape/components/Participants.tsx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pkg/interface/src/views/landscape/components/Participants.tsx b/pkg/interface/src/views/landscape/components/Participants.tsx index b51e08bbc8..2c642d3943 100644 --- a/pkg/interface/src/views/landscape/components/Participants.tsx +++ b/pkg/interface/src/views/landscape/components/Participants.tsx @@ -33,6 +33,7 @@ import { StatelessAsyncAction } from '~/views/components/StatelessAsyncAction'; import useLocalState from '~/logic/state/local'; import useContactState from '~/logic/state/contact'; import useSettingsState, { selectCalmState } from '~/logic/state/settings'; +import {deSig} from '@urbit/api'; const TruncText = styled(Text)` white-space: nowrap; @@ -55,11 +56,16 @@ const searchParticipant = (search: string) => (p: Participant) => { }; function getParticipants(cs: Contacts, group: Group) { - const contacts: Participant[] = _.map(cs, (c, patp) => ({ - ...c, - patp, - pending: false - })); + const contacts: Participant[] = _.flow( + f.omitBy((_c, patp) => !group.members.has(patp.slice(1))), + f.toPairs, + f.map(([patp, c]: [string, Contact]) => ({ + ...c, + patp, + pending: false + })) + )(cs); + console.log(contacts); const members: Participant[] = _.map( Array.from(group.members) .filter(e => group?.policy?.invite?.pending ? !group.policy.invite.pending.has(e) : true), m => @@ -84,7 +90,7 @@ const emptyContact = (patp: string, pending: boolean): Participant => ({ nickname: '', bio: '', status: '', - color: '', + color: '0x0', avatar: null, cover: null, groups: [],