RoomView: Display AppsDrawer if apps in room state
This commit is contained in:
parent
9e0b476b72
commit
99b1de7f0e
1 changed files with 6 additions and 0 deletions
|
@ -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";
|
||||||
|
|
Loading…
Reference in a new issue