Redirect to team when login with an invite (#4609)

Этот коммит содержится в:
enahum
2016-11-21 12:15:23 -03:00
коммит произвёл Corey Hulen
родитель ebb8c93baa
Коммит 20e931c047

Просмотреть файл

@@ -150,8 +150,8 @@ export default class LoginController extends React.Component {
query.d, query.d,
query.h, query.h,
query.id, query.id,
() => { (team) => {
this.finishSignin(); this.finishSignin(team);
}, },
() => { () => {
// there's not really a good way to deal with this, so just let the user log in like normal // there's not really a good way to deal with this, so just let the user log in like normal
@@ -195,13 +195,15 @@ export default class LoginController extends React.Component {
); );
} }
finishSignin() { finishSignin(team) {
GlobalActions.emitInitialLoad( GlobalActions.emitInitialLoad(
() => { () => {
const query = this.props.location.query; const query = this.props.location.query;
GlobalActions.loadDefaultLocale(); GlobalActions.loadDefaultLocale();
if (query.redirect_to) { if (query.redirect_to) {
browserHistory.push(query.redirect_to); browserHistory.push(query.redirect_to);
} else if (team) {
browserHistory.push(`/${team.name}`);
} else { } else {
browserHistory.push('/select_team'); browserHistory.push('/select_team');
} }