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