@symbo.ls/router 2.12.43 → 2.12.52

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.
Files changed (2) hide show
  1. package/index.js +5 -10
  2. 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
@@ -90,6 +83,8 @@ export const router = (
90
83
  element.state.update({ route, hash, routeInContent }, { preventUpdateTriggerStateUpdate: true, preventContentUpdate: true })
91
84
  }
92
85
 
86
+ console.log(isModal)
87
+ console.log(wasModal)
93
88
  if (hasSet) {
94
89
  element.set({
95
90
  tag: options.useFragment && 'fragment',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/router",
3
- "version": "2.12.43",
3
+ "version": "2.12.52",
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": "f742014461df83a79445041b110855f67ee52375",
14
+ "gitHead": "9c034337c16ea58ef05ac83bc1df99e4c5d35e24",
15
15
  "source": "index.js"
16
16
  }