mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-18 06:35:35 +08:00
RoomView: Display AppsDrawer if apps in room state
This commit is contained in:
parent
9e0b476b72
commit
99b1de7f0e
@ -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 New Issue
Block a user