From a88297d7a6eeadaecab0abf15a059c6255cf17d5 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 26 Jun 2018 16:27:17 +0100 Subject: [PATCH] More code reuse --- src/components/views/elements/AppTile.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/views/elements/AppTile.js b/src/components/views/elements/AppTile.js index 61d5a0f1ac..ea303a96b2 100644 --- a/src/components/views/elements/AppTile.js +++ b/src/components/views/elements/AppTile.js @@ -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});