Skip to content

Commit

Permalink
fix Cannot read property 'addEventListener' of null zuiidea#946
Browse files Browse the repository at this point in the history
  • Loading branch information
Baorong Li committed Mar 5, 2019
1 parent 76e5359 commit 29aa0f4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/layouts/PrimaryLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,18 @@ class PrimaryLayout extends PureComponent {

// Localized route name.

const lang = langFromPath(location.pathname);
const lang = langFromPath(location.pathname)
const newRouteList =
lang !== 'en'
lang !== 'en'
? routeList.map(item => {
const { name , ...other } = item
const { name, ...other } = item
return {
...other,
name: ((item[lang] || {}).name || name),
name: (item[lang] || {}).name || name,
}
})
: routeList


// Find a route that matches the pathname.
const currentRoute = newRouteList.find(
_ => _.route && pathMatchRegexp(_.route, location.pathname)
Expand Down Expand Up @@ -148,7 +147,7 @@ class PrimaryLayout extends PureComponent {
</Content>
<BackTop
className={styles.backTop}
target={() => document.querySelector('#primaryLayout>div')}
target={() => document.querySelector('#primaryLayout')}
/>
<GlobalFooter
className={styles.footer}
Expand Down

0 comments on commit 29aa0f4

Please sign in to comment.