File tree 1 file changed +8
-5
lines changed
packages/app/src/app/pages/Dashboard 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
1
import { 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
-
5
2
import { client } from 'app/graphql/client' ;
6
3
import { useOvermind } from 'app/overmind' ;
7
4
import { Navigation } from 'app/pages/common/Navigation' ;
5
+ import React , { FunctionComponent , useEffect , useState } from 'react' ;
6
+ import { Redirect , RouteComponentProps , withRouter } from 'react-router-dom' ;
8
7
9
8
import Content from './Content' ;
10
9
import {
11
10
Container ,
12
11
ContentContainer ,
13
12
LeftIcon ,
14
13
RightIcon ,
15
- SidebarContainer ,
16
14
ShowSidebarButton ,
15
+ SidebarContainer ,
17
16
} from './elements' ;
18
17
import { Sidebar } from './Sidebar' ;
19
18
@@ -23,7 +22,7 @@ const DashboardComponent: FunctionComponent<Props> = ({ history }) => {
23
22
actions : {
24
23
dashboard : { dashboardMounted } ,
25
24
} ,
26
- state : { hasLogIn } ,
25
+ state : { hasLogIn, isAuthenticating } ,
27
26
} = useOvermind ( ) ;
28
27
const [ showSidebar , setShowSidebar ] = useState ( false ) ;
29
28
@@ -42,6 +41,10 @@ const DashboardComponent: FunctionComponent<Props> = ({ history }) => {
42
41
setShowSidebar ( false ) ;
43
42
} ) ;
44
43
44
+ if ( isAuthenticating ) {
45
+ return null ;
46
+ }
47
+
45
48
if ( ! hasLogIn ) {
46
49
return < Redirect to = { signInPageUrl ( ) } /> ;
47
50
}
You can’t perform that action at this time.
0 commit comments