@akanjs/next 0.0.28 → 0.0.30

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/next",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "type": "commonjs",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -48,8 +48,7 @@
48
48
  "reflect-metadata": "^0.2.2",
49
49
  "socket.io": "^4.8.1",
50
50
  "socket.io-client": "^4.8.1",
51
- "tunnel-ssh": "^5.2.0",
52
- "zustand": "^5.0.2"
51
+ "tunnel-ssh": "^5.2.0"
53
52
  },
54
53
  "main": "./index.js"
55
54
  }
package/src/bootCsr.js CHANGED
@@ -122,11 +122,12 @@ const bootCsr = async (context, rootPath, entryPath = "/route") => {
122
122
  pathRoutes.forEach((pathRoute) => {
123
123
  const pathSegments = pathRoute.pathSegments.slice(1);
124
124
  pathSegments.reduce((routeGuide2, pathSegment, index) => {
125
+ const child = routeGuide2.children[pathSegment];
125
126
  routeGuide2.children[pathSegment] = {
126
- ...routeGuide2.children[pathSegment] ?? {},
127
+ ...child ?? {},
127
128
  pathSegment,
128
129
  ...index === pathSegments.length - 1 ? { pathRoute } : {},
129
- children: routeGuide2.children[pathSegment].children ?? {}
130
+ children: child?.children ?? {}
130
131
  };
131
132
  return routeGuide2.children[pathSegment];
132
133
  }, routeGuide);
@@ -548,7 +548,7 @@ const useCsrValues = (rootRouteGuide, pathRoutes) => {
548
548
  }
549
549
  };
550
550
  window.onpopstate = async (ev) => {
551
- const routeType = window.location.pathname === getCurrentLocation().pathname ? "forward" : window.location.pathname === getPrevLocation()?.pathname ? "back" : null;
551
+ const routeType = window.location.pathname === getCurrentLocation().pathname && history.current.type !== "back" ? "forward" : window.location.pathname === getPrevLocation()?.pathname ? "back" : null;
552
552
  const scrollTop = pageContentRef.current?.scrollTop ?? 0;
553
553
  if (!routeType)
554
554
  return;