mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
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:
@@ -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'
|
||||
|
||||
@@ -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/>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user