Skip to content

Commit 192c3cf

Browse files
fix dashboard as well
1 parent b118e5f commit 192c3cf

File tree

1 file changed

+8
-5
lines changed
  • packages/app/src/app/pages/Dashboard

1 file changed

+8
-5
lines changed

packages/app/src/app/pages/Dashboard/index.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
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-
52
import { client } from 'app/graphql/client';
63
import { useOvermind } from 'app/overmind';
74
import { Navigation } from 'app/pages/common/Navigation';
5+
import React, { FunctionComponent, useEffect, useState } from 'react';
6+
import { Redirect, RouteComponentProps, withRouter } from 'react-router-dom';
87

98
import Content from './Content';
109
import {
1110
Container,
1211
ContentContainer,
1312
LeftIcon,
1413
RightIcon,
15-
SidebarContainer,
1614
ShowSidebarButton,
15+
SidebarContainer,
1716
} from './elements';
1817
import { 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
}

0 commit comments

Comments
 (0)