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;
|
return;
|
||||||
}
|
}
|
||||||
this.setState({deleting: true});
|
this.setState({deleting: true});
|
||||||
MatrixClientPeg.get().sendStateEvent(
|
|
||||||
this.props.room.roomId,
|
WidgetUtils.setRoomWidget(
|
||||||
'im.vector.modular.widgets',
|
|
||||||
{}, // empty content
|
|
||||||
this.props.id,
|
this.props.id,
|
||||||
).then(() => {
|
null,
|
||||||
return WidgetUtils.waitForRoomWidget(this.props.id, this.props.room.roomId, false);
|
null,
|
||||||
}).catch((e) => {
|
null,
|
||||||
|
null,
|
||||||
|
this.props.room.roomId,
|
||||||
|
).catch((e) => {
|
||||||
console.error('Failed to delete widget', e);
|
console.error('Failed to delete widget', e);
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.setState({deleting: false});
|
this.setState({deleting: false});
|
||||||
|
|
Loading…
Reference in a new issue