mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 08:32:39 +03:00
Merge pull request #3984 from tylershuster/group-delete
groups: only prompt to delete on ownership
This commit is contained in:
commit
daa08c5bad
@ -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) {
|
||||
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