Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/router/guard/permissionGuard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -53,7 +50,6 @@ router.beforeEach(async (to, from, next) => {
}

next()
onProgressTimerDone()
return
}

Expand All @@ -72,14 +68,17 @@ 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()
})

function onProgressTimerDone() {
if (progressTimer && progressTimer !== 0) {
clearTimeout(progressTimer)
progressTimer = null
NProgress.done()
}
NProgress.done()
}