Commit 7df9903d authored by Zhou Fang's avatar Zhou Fang
Browse files

Fixed not showing error page properly issue

parent be309639
Pipeline #1728 passed with stage
......@@ -65,7 +65,8 @@ export default function MainPortal({
const classes = useStyles();
const [mobileOpen, setMobileOpen] = useState(false);
const { gotCSRF, currentUser } = useContext(GlobalContext);
const loggedIn = currentUser !== null;
// The loggedIn will only be true when the user is logged in and he/she is at least linked to 1 org
const loggedIn = currentUser !== null && currentUser.relation.length > 0;
const handleDrawerToggle = () => {
setMobileOpen(!mobileOpen);
};
......@@ -82,7 +83,7 @@ export default function MainPortal({
return (
<>
{currentUser && (
{loggedIn && (
<>
<AppTopBar handleDrawerToggle={handleDrawerToggle} />
<LeftNavBar mobileOpen={mobileOpen} handleDrawerToggle={handleDrawerToggle} />
......@@ -113,7 +114,7 @@ export default function MainPortal({
<Redirect to="/portal/dashboard" />
</Route>
</Switch>
<div className={classes.loginFooter}>
<div className={loggedIn ? '' : classes.loginFooter}>
<PortalFooter />
</div>
</>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment