Correcting the authenticated only links logic

This commit is contained in:
Unknown committed 2018-11-09 18:43:41 +01:00
1 parent bb03bc2e61
commit 9223971891
1 file changed
+3 -2
+3 -2
View File
@@ -76,7 +76,8 @@ class Header extends Component {
let user = JSON.parse(this.state.user)
const menus = allMenus.map(({ to, title, submenus, authenticated }, index) => {
if (authenticated) {
console.log(!authenticated)
if (authenticated && !(this.state.user !== undefined && this.state.user !== null)) {
return
}
return (
@@ -90,7 +91,7 @@ class Header extends Component {
<ul className='subMenu'>
{
submenus.map(({ icon: Icon, to: subTo, title: subTitle, externalLink, authenticated: subAuthenticated }, subindex) => {
if (subAuthenticated) {
if (subAuthenticated && !(this.state.user !== undefined && this.state.user !== null)) {
return
}
if (externalLink) {