File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
packages/app/src/app/pages/Dashboard Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 11import { signInPageUrl } from '@codesandbox/common/lib/utils/url-generator' ;
2- import React , { useState , useEffect , FunctionComponent } from 'react' ;
3- import { withRouter , Redirect , RouteComponentProps } from 'react-router-dom' ;
4-
52import { client } from 'app/graphql/client' ;
63import { useOvermind } from 'app/overmind' ;
74import { Navigation } from 'app/pages/common/Navigation' ;
5+ import React , { FunctionComponent , useEffect , useState } from 'react' ;
6+ import { Redirect , RouteComponentProps , withRouter } from 'react-router-dom' ;
87
98import Content from './Content' ;
109import {
1110 Container ,
1211 ContentContainer ,
1312 LeftIcon ,
1413 RightIcon ,
15- SidebarContainer ,
1614 ShowSidebarButton ,
15+ SidebarContainer ,
1716} from './elements' ;
1817import { Sidebar } from './Sidebar' ;
1918
@@ -23,7 +22,7 @@ const DashboardComponent: FunctionComponent<Props> = ({ history }) => {
2322 actions : {
2423 dashboard : { dashboardMounted } ,
2524 } ,
26- state : { hasLogIn } ,
25+ state : { hasLogIn, isAuthenticating } ,
2726 } = useOvermind ( ) ;
2827 const [ showSidebar , setShowSidebar ] = useState ( false ) ;
2928
@@ -42,6 +41,10 @@ const DashboardComponent: FunctionComponent<Props> = ({ history }) => {
4241 setShowSidebar ( false ) ;
4342 } ) ;
4443
44+ if ( isAuthenticating ) {
45+ return null ;
46+ }
47+
4548 if ( ! hasLogIn ) {
4649 return < Redirect to = { signInPageUrl ( ) } /> ;
4750 }
You can’t perform that action at this time.
0 commit comments