Moving single team redirect to backend
Этот коммит содержится в:
@@ -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});
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Ссылка в новой задаче
Block a user