diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-10-05 10:20:14 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-10-05 10:20:14 -0400 |
commit | f4afabd67999baabd06038cb6f3d664f2ebf77ba (patch) | |
tree | f839f71e9c072569fa119dd5a133daa955012f1b /web/react/components/navbar_dropdown.jsx | |
parent | 8595fd85c7b64e0e7f928abd398f1e0f5d62eea8 (diff) | |
parent | 3b34e7313251c5c9b7dde8c5916f83ab9e9f2a31 (diff) | |
download | chat-f4afabd67999baabd06038cb6f3d664f2ebf77ba.tar.gz chat-f4afabd67999baabd06038cb6f3d664f2ebf77ba.tar.bz2 chat-f4afabd67999baabd06038cb6f3d664f2ebf77ba.zip |
Merge pull request #903 from mattermost/PLT-44
PLT-44 allow team switching without the need to login
Diffstat (limited to 'web/react/components/navbar_dropdown.jsx')
-rw-r--r-- | web/react/components/navbar_dropdown.jsx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/web/react/components/navbar_dropdown.jsx b/web/react/components/navbar_dropdown.jsx index 57a78a0d4..78057d10b 100644 --- a/web/react/components/navbar_dropdown.jsx +++ b/web/react/components/navbar_dropdown.jsx @@ -9,7 +9,7 @@ var TeamStore = require('../stores/team_store.jsx'); var Constants = require('../utils/constants.jsx'); function getStateFromStores() { - return {teams: UserStore.getTeams(), currentTeam: TeamStore.getCurrent()}; + return {teams: UserStore.getTeams()}; } export default class NavbarDropdown extends React.Component { @@ -142,10 +142,10 @@ export default class NavbarDropdown extends React.Component { > </li> ); - if (this.state.teams.length > 1 && this.state.currentTeam) { - var curTeamName = this.state.currentTeam.name; + + if (this.state.teams.length > 1) { this.state.teams.forEach((teamName) => { - if (teamName !== curTeamName) { + if (teamName !== this.props.teamName) { teams.push(<li key={teamName}><a href={Utils.getWindowLocationOrigin() + '/' + teamName}>{'Switch to ' + teamName}</a></li>); } }); @@ -234,5 +234,7 @@ NavbarDropdown.defaultProps = { teamType: '' }; NavbarDropdown.propTypes = { - teamType: React.PropTypes.string + teamType: React.PropTypes.string, + teamDisplayName: React.PropTypes.string, + teamName: React.PropTypes.string }; |