mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-05 22:03:50 +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 () => {
|
const onClick = async () => {
|
||||||
if(group.hidden && recipients.length > 0) {
|
if(typeof recipients === 'string') {
|
||||||
await api.contacts.allowShips(recipients);
|
const [,,ship,name] = recipients.split('/');
|
||||||
await Promise.all(recipients.map(r => api.contacts.share(r)))
|
|
||||||
setShowBanner(false);
|
|
||||||
} else if (!group.hidden) {
|
|
||||||
const [,,ship,name] = groupPath.split('/');
|
|
||||||
await api.contacts.allowGroup(ship,name);
|
await api.contacts.allowGroup(ship,name);
|
||||||
if(ship !== `~${window.ship}`) {
|
if(ship !== `~${window.ship}`) {
|
||||||
await api.contacts.share(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
|
<Row
|
||||||
height="48px"
|
height="48px"
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
|
Loading…
Reference in New Issue
Block a user