Modifying login not to display until it has finished checking. Caused admin console to redirect to town-square. Will be changed after user model flip.

This commit is contained in:
Christopher Speller
2016-03-24 11:27:05 -04:00
parent b62e29ba9c
commit d6a6668a39
2 changed files with 6 additions and 3 deletions

View File

@@ -64,7 +64,7 @@ export default class AdminNavbarDropdown extends React.Component {
>
<li>
<Link
to={Utils.getWindowLocationOrigin() + '/' + this.state.currentTeam.name}
to={Utils.getWindowLocationOrigin() + '/' + this.state.currentTeam.name + '/channels/town-square'}
>
<FormattedMessage
id='admin.nav.switch'

View File

@@ -29,6 +29,8 @@ export default class Login extends React.Component {
Client.getMeLoggedIn((data) => {
if (data && data.logged_in !== 'false') {
browserHistory.push('/' + this.props.params.team + '/channels/town-square');
} else {
this.setState({doneCheckLogin: true}); //eslint-disable-line react/no-did-mount-set-state
}
});
}
@@ -37,7 +39,8 @@ export default class Login extends React.Component {
}
getStateFromStores() {
return {
currentTeam: TeamStore.getByName(this.props.params.team)
currentTeam: TeamStore.getByName(this.props.params.team),
doneCheckLogin: false
};
}
onTeamChange() {
@@ -45,7 +48,7 @@ export default class Login extends React.Component {
}
render() {
const currentTeam = this.state.currentTeam;
if (currentTeam == null) {
if (currentTeam == null || !this.state.doneCheckLogin) {
return <div/>;
}