RoomView: Display AppsDrawer if apps in room state

pull/21833/head
Robert Swain 2017-06-13 15:19:06 +02:00
parent 9e0b476b72
commit 99b1de7f0e
1 changed files with 6 additions and 0 deletions

View File

@ -251,12 +251,18 @@ module.exports = React.createClass({
} else if (isUserJoined) { } else if (isUserJoined) {
MatrixClientPeg.get().stopPeeking(); MatrixClientPeg.get().stopPeeking();
this.setState({ this.setState({
showApps: this._shouldShowApps(room),
unsentMessageError: this._getUnsentMessageError(room), unsentMessageError: this._getUnsentMessageError(room),
}); });
this._onRoomLoaded(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() { componentDidMount: function() {
var call = this._getCallForRoom(); var call = this._getCallForRoom();
var callState = call ? call.call_state : "ended"; var callState = call ? call.call_state : "ended";