Make UserSettings use the right teamToken

This threads the correct teamToken through to UserSettings for generating the referral section.
pull/21833/head
Luke Barnard 2017-02-16 18:00:52 +00:00
parent 6945e7c154
commit 406c34b715
2 changed files with 6 additions and 1 deletions

View File

@ -175,6 +175,7 @@ export default React.createClass({
collapsedRhs={this.props.collapse_rhs} collapsedRhs={this.props.collapse_rhs}
enableLabs={this.props.config.enableLabs} enableLabs={this.props.config.enableLabs}
referralBaseUrl={this.props.config.referralBaseUrl} referralBaseUrl={this.props.config.referralBaseUrl}
teamToken={this.props.teamToken}
/>; />;
if (!this.props.collapse_rhs) right_panel = <RightPanel opacity={this.props.sideOpacity}/>; if (!this.props.collapse_rhs) right_panel = <RightPanel opacity={this.props.sideOpacity}/>;
break; break;

View File

@ -109,6 +109,10 @@ module.exports = React.createClass({
// true if RightPanel is collapsed // true if RightPanel is collapsed
collapsedRhs: React.PropTypes.bool, collapsedRhs: React.PropTypes.bool,
// Team token for the referral link. If falsy, the referral section will
// not appear
teamToken: React.PropTypes.string,
}, },
getDefaultProps: function() { getDefaultProps: function() {
@ -462,7 +466,7 @@ module.exports = React.createClass({
}, },
_renderReferral: function() { _renderReferral: function() {
const teamToken = window.localStorage.getItem('mx_team_token'); const teamToken = this.props.teamToken;
if (!teamToken) { if (!teamToken) {
return null; return null;
} }