mirror of
https://github.com/urbit/shrub.git
synced 2024-12-20 01:01:37 +03:00
parent
f20da46745
commit
0a71df076f
@ -33,6 +33,7 @@ import { StatelessAsyncAction } from '~/views/components/StatelessAsyncAction';
|
|||||||
import useLocalState from '~/logic/state/local';
|
import useLocalState from '~/logic/state/local';
|
||||||
import useContactState from '~/logic/state/contact';
|
import useContactState from '~/logic/state/contact';
|
||||||
import useSettingsState, { selectCalmState } from '~/logic/state/settings';
|
import useSettingsState, { selectCalmState } from '~/logic/state/settings';
|
||||||
|
import {deSig} from '@urbit/api';
|
||||||
|
|
||||||
const TruncText = styled(Text)`
|
const TruncText = styled(Text)`
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
@ -55,11 +56,16 @@ const searchParticipant = (search: string) => (p: Participant) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function getParticipants(cs: Contacts, group: Group) {
|
function getParticipants(cs: Contacts, group: Group) {
|
||||||
const contacts: Participant[] = _.map(cs, (c, patp) => ({
|
const contacts: Participant[] = _.flow(
|
||||||
...c,
|
f.omitBy<Contacts>((_c, patp) => !group.members.has(patp.slice(1))),
|
||||||
patp,
|
f.toPairs,
|
||||||
pending: false
|
f.map(([patp, c]: [string, Contact]) => ({
|
||||||
}));
|
...c,
|
||||||
|
patp,
|
||||||
|
pending: false
|
||||||
|
}))
|
||||||
|
)(cs);
|
||||||
|
console.log(contacts);
|
||||||
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 =>
|
.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: '',
|
nickname: '',
|
||||||
bio: '',
|
bio: '',
|
||||||
status: '',
|
status: '',
|
||||||
color: '',
|
color: '0x0',
|
||||||
avatar: null,
|
avatar: null,
|
||||||
cover: null,
|
cover: null,
|
||||||
groups: [],
|
groups: [],
|
||||||
|
Loading…
Reference in New Issue
Block a user