More code de-duping
This commit is contained in:
parent
c780cd05a8
commit
0ee8d18f5a
1 changed files with 1 additions and 8 deletions
|
@ -163,14 +163,7 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
_getApps: function() {
|
_getApps: function() {
|
||||||
const appsStateEvents = this.props.room.currentState.getStateEvents('im.vector.modular.widgets');
|
return WidgetUtils.getRoomWidgets(this.props.room).map((ev) => {
|
||||||
if (!appsStateEvents) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return appsStateEvents.filter((ev) => {
|
|
||||||
return ev.getContent().type && ev.getContent().url;
|
|
||||||
}).map((ev) => {
|
|
||||||
return this._initAppConfig(ev.getStateKey(), ev.getContent(), ev.sender);
|
return this._initAppConfig(ev.getStateKey(), ev.getContent(), ev.sender);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue