@sledge-app/react-instant-search 2.0.65 → 2.0.67

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.
@@ -4468,8 +4468,7 @@ const VariantSelector = (props) => {
4468
4468
  setSelectedVariantId == null ? void 0 : setSelectedVariantId(variantId);
4469
4469
  if (inventoryQuantity)
4470
4470
  setSelectedVariantStock == null ? void 0 : setSelectedVariantStock(inventoryQuantity);
4471
- if (inventoryManagement)
4472
- setSelectedVariantInventoryManagement == null ? void 0 : setSelectedVariantInventoryManagement(inventoryManagement);
4471
+ setSelectedVariantInventoryManagement == null ? void 0 : setSelectedVariantInventoryManagement(inventoryManagement || null);
4473
4472
  if (inventoryPolicy)
4474
4473
  setSelectedVariantInventoryPolicy == null ? void 0 : setSelectedVariantInventoryPolicy(inventoryPolicy);
4475
4474
  if (price)
@@ -10768,6 +10767,17 @@ const ResultProduct = React__default.memo((props) => {
10768
10767
  ...props2
10769
10768
  });
10770
10769
  };
10770
+ React__default.useEffect(() => {
10771
+ const handlePopState = () => {
10772
+ const params2 = new URLSearchParams(window.location.search);
10773
+ const page = Number(params2.get("page")) || 1;
10774
+ const validPage = Math.max(1, Math.floor(page));
10775
+ setCurrentPage(validPage);
10776
+ setIsReplaceWidgetList == null ? void 0 : setIsReplaceWidgetList(true);
10777
+ };
10778
+ window.addEventListener("popstate", handlePopState);
10779
+ return () => window.removeEventListener("popstate", handlePopState);
10780
+ }, []);
10771
10781
  const handlePageChange = (page) => {
10772
10782
  const searchParams2 = new URLSearchParams(document.location.search);
10773
10783
  searchParams2.set(queryPage, String(page));
@@ -10781,7 +10791,7 @@ const ResultProduct = React__default.memo((props) => {
10781
10791
  });
10782
10792
  }, 200);
10783
10793
  if (!objectPresent(previewSettings))
10784
- window.history.replaceState(null, "", `${document.location.pathname}?${searchParams2.toString()}`);
10794
+ window.history.pushState(null, "", `${document.location.pathname}?${searchParams2.toString()}`);
10785
10795
  };
10786
10796
  React__default.useEffect(() => {
10787
10797
  var _a2, _b2, _c2, _d2;