mirror of
https://github.com/urbit/shrub.git
synced 2024-11-28 05:22:27 +03:00
parent
6bb62d802b
commit
446f551ab6
@ -34,10 +34,12 @@ function DeleteGroup(props: {
|
||||
const history = useHistory();
|
||||
const onDelete = async () => {
|
||||
const name = props.association['group-path'].split('/').pop();
|
||||
if (prompt(`To confirm deleting this group, type ${name}`) === name) {
|
||||
await props.api.contacts.delete(props.association["group-path"]);
|
||||
history.push("/");
|
||||
if (props.owner) {
|
||||
const shouldDelete = (prompt(`To confirm deleting this group, type ${name}`) === name);
|
||||
if (!shouldDelete) return;
|
||||
}
|
||||
await props.api.contacts.delete(props.association["group-path"]);
|
||||
history.push("/");
|
||||
};
|
||||
|
||||
const action = props.owner ? "Delete" : "Leave";
|
||||
|
Loading…
Reference in New Issue
Block a user