summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-10-28 08:58:27 -0700
committer=Corey Hulen <corey@hulen.com>2015-10-28 08:58:27 -0700
commit0b967b2acb5d5dc2da4f18c20a1cc4f8d1c8d8b1 (patch)
treebac3d1f47d838a152a97b84c14bb3be34fee417b /web
parent953e27cdf7037a70b9c5b7ba7cd94aab40f17de9 (diff)
downloadchat-0b967b2acb5d5dc2da4f18c20a1cc4f8d1c8d8b1.tar.gz
chat-0b967b2acb5d5dc2da4f18c20a1cc4f8d1c8d8b1.tar.bz2
chat-0b967b2acb5d5dc2da4f18c20a1cc4f8d1c8d8b1.zip
Moving single team redirect to backend
Diffstat (limited to 'web')
-rw-r--r--web/react/components/signup_team.jsx6
-rw-r--r--web/web.go7
2 files changed, 5 insertions, 8 deletions
diff --git a/web/react/components/signup_team.jsx b/web/react/components/signup_team.jsx
index 814ec2fc1..f926f5cbb 100644
--- a/web/react/components/signup_team.jsx
+++ b/web/react/components/signup_team.jsx
@@ -36,12 +36,6 @@ export default class TeamSignUp extends React.Component {
}
}
- componentDidMount() {
- if (global.window.mm_config.EnableTeamListing === 'true' && this.props.teams.length === 1) {
- window.location.href = '/' + this.props.teams[0].name;
- }
- }
-
updatePage(page) {
this.setState({page});
}
diff --git a/web/web.go b/web/web.go
index 3cfda39e7..424adea93 100644
--- a/web/web.go
+++ b/web/web.go
@@ -166,11 +166,14 @@ func root(c *api.Context, w http.ResponseWriter, r *http.Request) {
return
} else {
teams := result.Data.([]*model.Team)
- l4g.Info(teams)
-
for _, team := range teams {
page.Props[team.Name] = team.DisplayName
}
+
+ if len(teams) == 1 && *utils.Cfg.TeamSettings.EnableTeamListing {
+ http.Redirect(w, r, c.GetSiteURL()+"/"+teams[0].Name, http.StatusTemporaryRedirect)
+ return
+ }
}
page.Render(c, w)