Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
Check if window object exists on MenuBar component
Browse files Browse the repository at this point in the history
  • Loading branch information
cbillowes committed Dec 17, 2018
1 parent b574763 commit 829c7bd
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/components/Componlets/MenuBar/Component.jsx
Expand Up @@ -11,18 +11,20 @@ class MenuBar extends Component {
}

getSelected = () => {
let url = window.location.href;
if (url.endsWith("/")) {
return "Home";
}
if (url.endsWith("/about")) {
return "About";
}
if (url.endsWith("/credits")) {
return "Credits";
}
if (url.endsWith("/privacy-policy")) {
return "Privacy Policy";
if (window) {
let url = window.location.href;
if (url.endsWith("/")) {
return "Home";
}
if (url.endsWith("/about")) {
return "About";
}
if (url.endsWith("/credits")) {
return "Credits";
}
if (url.endsWith("/privacy-policy")) {
return "Privacy Policy";
}
}
}

Expand Down

0 comments on commit 829c7bd

Please sign in to comment.