Browse Source

fix: no processing bar for page jumps longer than 250ms (#539)

Signed-off-by: Ryan Wang <i@ryanc.cc>
pull/541/head
Ryan Wang 3 years ago committed by GitHub
parent
commit
5ed960f633
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      src/router/guard/permissionGuard.js

11
src/router/guard/permissionGuard.js

@ -15,9 +15,6 @@ router.beforeEach(async (to, from, next) => {
NProgress.start()
}, 250)
// set title meta
to.meta && typeof to.meta.title !== 'undefined' && setDocumentTitle(`${to.meta.title} - ${domTitle}`)
// check installation status
if (store.getters.isInstalled === undefined) {
await store.dispatch('fetchIsInstalled')
@ -53,7 +50,6 @@ router.beforeEach(async (to, from, next) => {
}
next()
onProgressTimerDone()
return
}
@ -72,7 +68,10 @@ router.beforeEach(async (to, from, next) => {
onProgressTimerDone()
})
router.afterEach(() => {
router.afterEach(to => {
// set title meta
to.meta && typeof to.meta.title !== 'undefined' && setDocumentTitle(`${to.meta.title} - ${domTitle}`)
onProgressTimerDone()
})
@ -80,6 +79,6 @@ function onProgressTimerDone() {
if (progressTimer && progressTimer !== 0) {
clearTimeout(progressTimer)
progressTimer = null
NProgress.done()
}
NProgress.done()
}

Loading…
Cancel
Save