More code reuse
This commit is contained in:
parent
9539a749e5
commit
a88297d7a6
1 changed files with 8 additions and 7 deletions
|
@ -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});
|
||||
|
|
Loading…
Reference in a new issue