mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 06:35:32 +03:00
Merge pull request #3443 from tylershuster/group-confirm-delete
groups: add group deletion confirmation
This commit is contained in:
commit
a1b06689d5
@ -324,11 +324,13 @@ export class GroupDetail extends Component {
|
||||
<a className={'dib f9 ba pa2 ' + deleteButtonClasses}
|
||||
onClick={() => {
|
||||
if (groupOwner) {
|
||||
this.setState({ awaiting: true, type: 'Deleting' }, (() => {
|
||||
props.api.contacts.delete(props.path).then(() => {
|
||||
props.history.push('/~groups');
|
||||
});
|
||||
}));
|
||||
if (prompt(`To confirm deleting this group, type ${props.path.substr(6)}`) === props.path.substr(6)) {
|
||||
this.setState({ awaiting: true, type: 'Deleting' }, (() => {
|
||||
props.api.contacts.delete(props.path).then(() => {
|
||||
props.history.push('/~groups');
|
||||
});
|
||||
}));
|
||||
}
|
||||
}
|
||||
}}
|
||||
>Delete this group</a>
|
||||
|
Loading…
Reference in New Issue
Block a user