From 83a8667fb3be569be2e8227d1869647eb95f6013 Mon Sep 17 00:00:00 2001 From: SleepWalker Date: Mon, 1 Jan 2018 19:24:14 +0200 Subject: [PATCH] Hot fix for the isSidebarHidden state issue --- src/pages/auth/AuthPage.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pages/auth/AuthPage.js b/src/pages/auth/AuthPage.js index eb9e334..083bde6 100644 --- a/src/pages/auth/AuthPage.js +++ b/src/pages/auth/AuthPage.js @@ -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 });