Skip to content

Commit

Permalink
Merge pull request zuiidea#284 from zuiidea/develop
Browse files Browse the repository at this point in the history
fix NProgress
  • Loading branch information
zuiidea authored May 12, 2017
2 parents 19e07ae + 47ae751 commit b4699e7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/routes/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ import NProgress from 'nprogress'
const { prefix } = config

const { Header, Bread, Footer, Sider, styles } = Layout
let lastHref

const App = ({ children, location, dispatch, app, loading }) => {
const { user, siderFold, darkTheme, isNavbar, menuPopoverVisible, navOpenKeys } = app
const href = window.location.href

NProgress.start()
!loading.global && NProgress.done()
if (lastHref !== href) {
NProgress.start()
if (!loading.global) {
NProgress.done()
lastHref = href
}
}

const headerProps = {
menu,
Expand Down

0 comments on commit b4699e7

Please sign in to comment.