From 78aaf6b47ed83fb636df99553f705293b12f14ca Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Fri, 10 Feb 2017 09:56:15 +0000 Subject: [PATCH] Use the teamToken threaded through from react sdk The bottom left menu now uses the same teamToken that the rest of the components use. This will require changes to react-sdk: https://github.com/matrix-org/matrix-react-sdk/pull/684 --- src/components/structures/BottomLeftMenu.js | 10 ++-------- src/components/structures/LeftPanel.js | 7 ++++++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/components/structures/BottomLeftMenu.js b/src/components/structures/BottomLeftMenu.js index ffb867fe5..f378cac62 100644 --- a/src/components/structures/BottomLeftMenu.js +++ b/src/components/structures/BottomLeftMenu.js @@ -27,6 +27,7 @@ module.exports = React.createClass({ propTypes: { collapsed: React.PropTypes.bool.isRequired, + teamToken: React.PropTypes.string, }, getInitialState: function() { @@ -36,13 +37,6 @@ module.exports = React.createClass({ homeHover: false, peopleHover : false, settingsHover : false, - teamToken: null, - }); - }, - - componentWillMount: function() { - this.setState({ - teamToken: window.localStorage.getItem('mx_team_token'), }); }, @@ -122,7 +116,7 @@ module.exports = React.createClass({ var TintableSvg = sdk.getComponent('elements.TintableSvg'); var homeButton; - if (this.state.teamToken) { + if (this.props.teamToken) { homeButton = ( diff --git a/src/components/structures/LeftPanel.js b/src/components/structures/LeftPanel.js index 87c75283f..a9df37a8b 100644 --- a/src/components/structures/LeftPanel.js +++ b/src/components/structures/LeftPanel.js @@ -28,6 +28,11 @@ var CallHandler = require("matrix-react-sdk/lib/CallHandler"); var LeftPanel = React.createClass({ displayName: 'LeftPanel', + propTypes: { + collapsed: React.PropTypes.bool.isRequired, + teamToken: React.PropTypes.string, + }, + getInitialState: function() { return { showCallElement: null, @@ -124,7 +129,7 @@ var LeftPanel = React.createClass({ collapsed={this.props.collapsed} searchFilter={this.state.searchFilter} ConferenceHandler={VectorConferenceHandler} /> - + ); }