More code reuse

This commit is contained in:
David Baker 2018-06-26 16:27:17 +01:00
parent 9539a749e5
commit a88297d7a6

View file

@ -319,14 +319,15 @@ export default class AppTile extends React.Component {
return;
}
this.setState({deleting: true});
MatrixClientPeg.get().sendStateEvent(
this.props.room.roomId,
'im.vector.modular.widgets',
{}, // empty content
WidgetUtils.setRoomWidget(
this.props.id,
).then(() => {
return WidgetUtils.waitForRoomWidget(this.props.id, this.props.room.roomId, false);
}).catch((e) => {
null,
null,
null,
null,
this.props.room.roomId,
).catch((e) => {
console.error('Failed to delete widget', e);
}).finally(() => {
this.setState({deleting: false});