Set team token in state on mount

This commit is contained in:
Luke Barnard 2017-02-07 11:39:31 +00:00
parent d490bd8638
commit 35bc384c51

View File

@ -35,9 +35,14 @@ module.exports = React.createClass({
homeHover: false,
peopleHover : false,
settingsHover : false,
teamToken: null,
});
},
componentWillMount: function() {
this.teamToken = window.localStorage.getItem('mx_team_token');
},
// Room events
onDirectoryClick: function() {
dis.dispatch({ action: 'view_room_directory' });
@ -114,7 +119,7 @@ module.exports = React.createClass({
var TintableSvg = sdk.getComponent('elements.TintableSvg');
var homeButton;
if (window.localStorage.getItem('mx_team_token')) {
if (this.state.teamToken) {
homeButton = (
<div className="mx_BottomLeftMenu_homePage" onClick={ this.onHomeClick } onMouseEnter={ this.onHomeMouseEnter } onMouseLeave={ this.onHomeMouseLeave } >
<TintableSvg src="img/icons-home.svg" width="25" height="25" />