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.
Этот коммит содержится в:
@@ -64,7 +64,7 @@ export default class AdminNavbarDropdown extends React.Component {
|
|||||||
>
|
>
|
||||||
<li>
|
<li>
|
||||||
<Link
|
<Link
|
||||||
to={Utils.getWindowLocationOrigin() + '/' + this.state.currentTeam.name}
|
to={Utils.getWindowLocationOrigin() + '/' + this.state.currentTeam.name + '/channels/town-square'}
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='admin.nav.switch'
|
id='admin.nav.switch'
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ export default class Login extends React.Component {
|
|||||||
Client.getMeLoggedIn((data) => {
|
Client.getMeLoggedIn((data) => {
|
||||||
if (data && data.logged_in !== 'false') {
|
if (data && data.logged_in !== 'false') {
|
||||||
browserHistory.push('/' + this.props.params.team + '/channels/town-square');
|
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() {
|
getStateFromStores() {
|
||||||
return {
|
return {
|
||||||
currentTeam: TeamStore.getByName(this.props.params.team)
|
currentTeam: TeamStore.getByName(this.props.params.team),
|
||||||
|
doneCheckLogin: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
onTeamChange() {
|
onTeamChange() {
|
||||||
@@ -45,7 +48,7 @@ export default class Login extends React.Component {
|
|||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
const currentTeam = this.state.currentTeam;
|
const currentTeam = this.state.currentTeam;
|
||||||
if (currentTeam == null) {
|
if (currentTeam == null || !this.state.doneCheckLogin) {
|
||||||
return <div/>;
|
return <div/>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user