Skip to content

Commit 9784316

Browse files
manikondadb3922
andauthored
Fixing black page showing up sometimes when login with the new browser session (#18)
Fixing black page showing up sometimes when login with the new browser session. This ensures Vue Router re-resolves /dashboard against the route table after the dynamic routes have been added via router.addRoute(), rather than reusing the stale to object that was resolved when /dashboard didn't exist yet (causing the blank page on first login). Co-authored-by: DamonB <60749822+db3922@users.noreply.github.com>
1 parent f90bb58 commit 9784316

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

‎ui/src/permission.js‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,7 @@ router.beforeEach((to, from, next) => {
107107
router.addRoute(route)
108108
})
109109
const redirect = decodeURIComponent(from.query.redirect || to.path)
110-
if (to.path === redirect) {
111-
next({ ...to, replace: true })
112-
} else {
113-
next({ path: redirect })
114-
}
110+
next({ path: redirect, replace: true, query: to.query, hash: to.hash })
115111
var project = vueProps.$localStorage.get(CURRENT_PROJECT)
116112
if (project == null) {
117113
project = {}

0 commit comments

Comments
 (0)