summaryrefslogtreecommitdiffstats
path: root/web/react/components/navbar_dropdown.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'web/react/components/navbar_dropdown.jsx')
-rw-r--r--web/react/components/navbar_dropdown.jsx13
1 files changed, 8 insertions, 5 deletions
diff --git a/web/react/components/navbar_dropdown.jsx b/web/react/components/navbar_dropdown.jsx
index 49d517419..b3f8e4418 100644
--- a/web/react/components/navbar_dropdown.jsx
+++ b/web/react/components/navbar_dropdown.jsx
@@ -145,7 +145,7 @@ export default class NavbarDropdown extends React.Component {
var teams = [];
- if (this.state.teams.length > 1) {
+ if (Object.keys(this.state.teams).length > 1) {
teams.push(
<li
className='divider'
@@ -154,11 +154,14 @@ export default class NavbarDropdown extends React.Component {
</li>
);
- this.state.teams.forEach((teamName) => {
- if (teamName !== this.props.teamName) {
- teams.push(<li key={teamName}><a href={Utils.getWindowLocationOrigin() + '/' + teamName}>{'Switch to ' + teamName}</a></li>);
+ for (let teamId in this.state.teams) {
+ if (this.state.teams.hasOwnProperty(teamId)) {
+ let team = this.state.teams[teamId];
+ if (team.name !== this.props.teamName) {
+ teams.push(<li key={team.name}><a href={Utils.getWindowLocationOrigin() + '/' + team.name}>{'Switch to ' + team.display_name}</a></li>);
+ }
}
- });
+ }
}
if (global.window.config.EnableTeamCreation === 'true') {