From 99b1de7f0e886166a50885418cb3e021e5a0de7e Mon Sep 17 00:00:00 2001 From: Robert Swain Date: Tue, 13 Jun 2017 15:19:06 +0200 Subject: [PATCH] RoomView: Display AppsDrawer if apps in room state --- src/components/structures/RoomView.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 29534727a2..4d7ac46ab4 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -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";