@symbo.ls/router 2.12.43 → 2.12.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -10
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -4,6 +4,8 @@ import { setCookie } from '@domql/cookie'
|
|
|
4
4
|
import { redirectBasedOnAuth } from '@symbo.ls/auth-redirect'
|
|
5
5
|
import { checkRouteModal } from '@symbo.ls/platform-utils'
|
|
6
6
|
|
|
7
|
+
const { location } = window
|
|
8
|
+
|
|
7
9
|
export const getActiveRoute = (level = 0, route = window.location.pathname) => {
|
|
8
10
|
const routeArray = route.split('/')
|
|
9
11
|
const activeRoute = routeArray[level + 1]
|
|
@@ -48,8 +50,6 @@ export const router = (
|
|
|
48
50
|
|
|
49
51
|
if (options.authCheck) {
|
|
50
52
|
const authRedirect = redirectBasedOnAuth(rootRoute, element, element.state)
|
|
51
|
-
// console.log('authRedirect')
|
|
52
|
-
// console.log(authRedirect)
|
|
53
53
|
|
|
54
54
|
if (authRedirect && rootRoute !== authRedirect) {
|
|
55
55
|
routeArray = authRedirect.split('/')
|
|
@@ -59,16 +59,9 @@ export const router = (
|
|
|
59
59
|
const route = routeArray.join('/').replace('//', '/')
|
|
60
60
|
const routeInContent = `/${routeArray[lastLevel + 1] || ''}`
|
|
61
61
|
|
|
62
|
-
// console.log('rootRoute')
|
|
63
|
-
// console.log(rootRoute)
|
|
64
|
-
// console.log('route')
|
|
65
|
-
// console.log(route)
|
|
66
|
-
// console.log('routeInContent')
|
|
67
|
-
// console.log(routeInContent)
|
|
68
|
-
|
|
69
62
|
const content = element.routes[routeInContent] || element.routes['/*']
|
|
70
63
|
|
|
71
|
-
const wasModal = checkRouteModal(pathname, element)
|
|
64
|
+
const wasModal = checkRouteModal(location.pathname.split('#')[0], element)
|
|
72
65
|
const isInitial = options.initialRender
|
|
73
66
|
const hashChanged = hash && hash !== window.location.hash.slice(1)
|
|
74
67
|
const pathChanged = pathname !== lastPathname
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/router",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.53",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -11,6 +11,6 @@
|
|
|
11
11
|
"@domql/utils": "latest",
|
|
12
12
|
"@symbo.ls/auth-redirect": "latest"
|
|
13
13
|
},
|
|
14
|
-
"gitHead": "
|
|
14
|
+
"gitHead": "929b3ddadd26272b059c9615d8c77c6b72f89eba",
|
|
15
15
|
"source": "index.js"
|
|
16
16
|
}
|