Hot fix for the isSidebarHidden state issue

This commit is contained in:
SleepWalker 2018-01-01 19:24:14 +02:00
parent 94217ff519
commit 83a8667fb3

View File

@ -21,6 +21,12 @@ import Finish from 'components/auth/finish/Finish';
import styles from './auth.scss';
// TODO: after migrating to new react router (posibly) this view started remounting
// after route change e.g. /login -> /password which results in state dropping
// we should find why this view is remounting or move isSidebarHidden into store
// so that it persist disregarding remounts
let isSidebarHiddenCache = false;
class AuthPage extends Component<{
client: {
id: string,
@ -31,7 +37,7 @@ class AuthPage extends Component<{
isSidebarHidden: bool
}> {
state = {
isSidebarHidden: false
isSidebarHidden: isSidebarHiddenCache
};
render() {
@ -66,6 +72,8 @@ class AuthPage extends Component<{
}
onGoToAuth = () => {
isSidebarHiddenCache = true;
this.setState({
isSidebarHidden: true
});