RoomView: Display AppsDrawer if apps in room state

This commit is contained in:
Robert Swain 2017-06-13 15:19:06 +02:00
parent 9e0b476b72
commit 99b1de7f0e

View file

@ -251,12 +251,18 @@ module.exports = React.createClass({
} else if (isUserJoined) {
MatrixClientPeg.get().stopPeeking();
this.setState({
showApps: this._shouldShowApps(room),
unsentMessageError: this._getUnsentMessageError(room),
});
this._onRoomLoaded(room);
}
},
_shouldShowApps: function(room) {
const appsStateEvents = room.currentState.getStateEvents('im.vector.modular.widgets', '');
return appsStateEvents && Object.keys(appsStateEvents.getContent()).length > 0;
},
componentDidMount: function() {
var call = this._getCallForRoom();
var callState = call ? call.call_state : "ended";