@sledge-app/react-instant-search 0.0.77 → 0.0.79
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/dist/components/ProductFilterWidget/ProductFilterWidget.d.ts +2 -0
- package/dist/components/ProductFilterWidget/ProductFilterWidget.d.ts.map +1 -1
- package/dist/sledge-react-instant-search.cjs +1 -1
- package/dist/sledge-react-instant-search.cjs.map +1 -1
- package/dist/sledge-react-instant-search.js +5 -5
- package/dist/sledge-react-instant-search.js.map +1 -1
- package/package.json +1 -1
|
@@ -2679,10 +2679,11 @@ const SearchResultWidget = (props) => {
|
|
|
2679
2679
|
productCardsComponent = productCard;
|
|
2680
2680
|
}
|
|
2681
2681
|
});
|
|
2682
|
-
const
|
|
2682
|
+
const searchParams = typeof document !== "undefined" ? new URLSearchParams((_a = document == null ? void 0 : document.location) == null ? void 0 : _a.search) : null;
|
|
2683
|
+
const [settings] = React__default.useState(typeof localStorage !== "undefined" ? JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING) || "{}") : {});
|
|
2683
2684
|
const [isFirstLoading, setIsFirstLoading] = React__default.useState(true);
|
|
2684
2685
|
const [isLoading, setIsLoading] = React__default.useState(true);
|
|
2685
|
-
const [keyword, setKeyword] = React__default.useState(
|
|
2686
|
+
const [keyword, setKeyword] = React__default.useState(searchParams == null ? void 0 : searchParams.get(queryKeyword));
|
|
2686
2687
|
const [clickedTabIndexId, setClickedTabIndexId] = React__default.useState(null);
|
|
2687
2688
|
const [clickedTabIndexName, setClickedTabIndexName] = React__default.useState();
|
|
2688
2689
|
const [resultComponent, setResultComponent] = React__default.useState(/* @__PURE__ */ jsxRuntimeExports.jsx(ResultProduct, {}));
|
|
@@ -2749,7 +2750,6 @@ const SearchResultWidget = (props) => {
|
|
|
2749
2750
|
if (propsData && initStatesFirstTime) {
|
|
2750
2751
|
response = propsData.result;
|
|
2751
2752
|
setInitStatesFirstTime(false);
|
|
2752
|
-
response = await multiSearch(body);
|
|
2753
2753
|
} else
|
|
2754
2754
|
response = await multiSearch(body);
|
|
2755
2755
|
if (!response)
|
|
@@ -2833,8 +2833,8 @@ const SearchResultWidget = (props) => {
|
|
|
2833
2833
|
React__default.useEffect(() => {
|
|
2834
2834
|
if (!(isRenderApp == null ? void 0 : isRenderApp.instantSearch))
|
|
2835
2835
|
return;
|
|
2836
|
-
const
|
|
2837
|
-
setKeyword((
|
|
2836
|
+
const searchParams2 = new URLSearchParams(document.location.search);
|
|
2837
|
+
setKeyword((searchParams2 == null ? void 0 : searchParams2.get(queryKeyword)) || "");
|
|
2838
2838
|
handleSettings(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING) || "");
|
|
2839
2839
|
}, [isRenderApp]);
|
|
2840
2840
|
React__default.useEffect(() => {
|