Remove logging.
Return early.
This commit is contained in:
parent
54bd916862
commit
8b7f737c97
1 changed files with 12 additions and 14 deletions
|
@ -183,21 +183,19 @@ export default React.createClass({
|
||||||
</div>,
|
</div>,
|
||||||
button: _t("Delete widget"),
|
button: _t("Delete widget"),
|
||||||
onFinished: (confirmed) => {
|
onFinished: (confirmed) => {
|
||||||
if (confirmed) {
|
if (!confirmed) {
|
||||||
console.log("Delete widget %s", this.props.id);
|
return;
|
||||||
|
}
|
||||||
this.setState({deleting: true});
|
this.setState({deleting: true});
|
||||||
MatrixClientPeg.get().sendStateEvent(
|
MatrixClientPeg.get().sendStateEvent(
|
||||||
this.props.room.roomId,
|
this.props.room.roomId,
|
||||||
'im.vector.modular.widgets',
|
'im.vector.modular.widgets',
|
||||||
{}, // empty content
|
{}, // empty content
|
||||||
this.props.id,
|
this.props.id,
|
||||||
).then(() => {
|
).catch((e) => {
|
||||||
console.log('Deleted widget');
|
|
||||||
}, (e) => {
|
|
||||||
console.error('Failed to delete widget', e);
|
console.error('Failed to delete widget', e);
|
||||||
this.setState({deleting: false});
|
this.setState({deleting: false});
|
||||||
});
|
});
|
||||||
}
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue