mirror of
https://github.com/urbit/shrub.git
synced 2024-12-11 11:02:25 +03:00
ShareProfile: refactor to remove dead props
This commit is contained in:
parent
053e392c5c
commit
a1c433b455
@ -40,21 +40,20 @@ export const ShareProfile = (props) => {
|
||||
);
|
||||
|
||||
const onClick = async () => {
|
||||
if(group.hidden && recipients.length > 0) {
|
||||
await api.contacts.allowShips(recipients);
|
||||
await Promise.all(recipients.map(r => api.contacts.share(r)))
|
||||
setShowBanner(false);
|
||||
} else if (!group.hidden) {
|
||||
const [,,ship,name] = groupPath.split('/');
|
||||
if(typeof recipients === 'string') {
|
||||
const [,,ship,name] = recipients.split('/');
|
||||
await api.contacts.allowGroup(ship,name);
|
||||
if(ship !== `~${window.ship}`) {
|
||||
await api.contacts.share(ship);
|
||||
}
|
||||
setShowBanner(false);
|
||||
}
|
||||
} else if(recipients.length > 0) {
|
||||
await api.contacts.allowShips(recipients);
|
||||
await Promise.all(recipients.map(r => api.contacts.share(r)))
|
||||
}
|
||||
props.onShare();
|
||||
};
|
||||
|
||||
return showBanner ? (
|
||||
return props.recipients?.length > 0 ? (
|
||||
<Row
|
||||
height="48px"
|
||||
alignItems="center"
|
||||
|
Loading…
Reference in New Issue
Block a user