Remove logging.

Return early.
pull/21833/head
Richard Lewis 2017-10-23 23:47:37 +01:00
parent 54bd916862
commit 8b7f737c97
1 changed files with 12 additions and 14 deletions

View File

@ -183,21 +183,19 @@ export default React.createClass({
</div>,
button: _t("Delete widget"),
onFinished: (confirmed) => {
if (confirmed) {
console.log("Delete widget %s", this.props.id);
this.setState({deleting: true});
MatrixClientPeg.get().sendStateEvent(
this.props.room.roomId,
'im.vector.modular.widgets',
{}, // empty content
this.props.id,
).then(() => {
console.log('Deleted widget');
}, (e) => {
console.error('Failed to delete widget', e);
this.setState({deleting: false});
});
if (!confirmed) {
return;
}
this.setState({deleting: true});
MatrixClientPeg.get().sendStateEvent(
this.props.room.roomId,
'im.vector.modular.widgets',
{}, // empty content
this.props.id,
).catch((e) => {
console.error('Failed to delete widget', e);
this.setState({deleting: false});
});
},
});
} else {