@akanjs/next 0.9.38 → 0.9.40

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.
@@ -542,10 +542,11 @@ const useCsrValues = (rootRouteGuide, pathRoutes) => {
542
542
  window.history.pushState({}, "", href);
543
543
  },
544
544
  replace: (href, { scrollToTop } = {}) => {
545
- if (location.href === href) {
545
+ const location2 = getCurrentLocation();
546
+ if (location2.href === href) {
546
547
  if (!pageContentRef.current)
547
548
  return;
548
- pageContentRef.current.scrollTop = getScrollTop(location);
549
+ pageContentRef.current.scrollTop = getScrollTop(location2);
549
550
  return;
550
551
  }
551
552
  const scrollTop = pageContentRef.current?.scrollTop ?? 0;
@@ -524,10 +524,11 @@ const useCsrValues = (rootRouteGuide, pathRoutes) => {
524
524
  window.history.pushState({}, "", href);
525
525
  },
526
526
  replace: (href, { scrollToTop } = {}) => {
527
- if (location.href === href) {
527
+ const location2 = getCurrentLocation();
528
+ if (location2.href === href) {
528
529
  if (!pageContentRef.current)
529
530
  return;
530
- pageContentRef.current.scrollTop = getScrollTop(location);
531
+ pageContentRef.current.scrollTop = getScrollTop(location2);
531
532
  return;
532
533
  }
533
534
  const scrollTop = pageContentRef.current?.scrollTop ?? 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/next",
3
- "version": "0.9.38",
3
+ "version": "0.9.40",
4
4
  "sourceType": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"