From 0ee8d18f5aff89a8dabb4c1ca5a2ae1cf6ce179e Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 26 Jun 2018 16:41:44 +0100 Subject: [PATCH] More code de-duping --- src/components/views/rooms/AppsDrawer.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/components/views/rooms/AppsDrawer.js b/src/components/views/rooms/AppsDrawer.js index ecf9859d2b..04e47f0f9f 100644 --- a/src/components/views/rooms/AppsDrawer.js +++ b/src/components/views/rooms/AppsDrawer.js @@ -163,14 +163,7 @@ module.exports = React.createClass({ }, _getApps: function() { - const appsStateEvents = this.props.room.currentState.getStateEvents('im.vector.modular.widgets'); - if (!appsStateEvents) { - return []; - } - - return appsStateEvents.filter((ev) => { - return ev.getContent().type && ev.getContent().url; - }).map((ev) => { + return WidgetUtils.getRoomWidgets(this.props.room).map((ev) => { return this._initAppConfig(ev.getStateKey(), ev.getContent(), ev.sender); }); },