@sledge-app/react-instant-search 0.0.83 → 0.0.85

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.
@@ -2383,11 +2383,8 @@ const SearchIconWidgetPopup = () => {
2383
2383
  const [isLoading, setIsLoading] = React__default.useState(true);
2384
2384
  const [showInfo, setShowInfo] = React__default.useState(false);
2385
2385
  const [keyword, setKeyword] = React__default.useState("");
2386
- const [suffixIndexProduct, setSuffixIndexProduct] = React__default.useState("");
2387
2386
  const [searchResultProduct, setSearchResultProduct] = React__default.useState([]);
2388
2387
  const [searchResultOther, setSearchResultOther] = React__default.useState([]);
2389
- const [allowedTabs, setAllowedTabs] = React__default.useState([]);
2390
- const [hiddenTags, setHiddenTags] = React__default.useState([]);
2391
2388
  const [displaySettings, setDisplaySettings] = React__default.useState({});
2392
2389
  const [suggestionSettings, setSuggestionSettings] = React__default.useState({});
2393
2390
  const [suggestionIndex, setSuggestionIndex] = React__default.useState("");
@@ -2472,10 +2469,7 @@ const SearchIconWidgetPopup = () => {
2472
2469
  response = JSON.parse(LOCAL_STORAGE_INSTANT_SEARCH_SETTING);
2473
2470
  if (!response)
2474
2471
  return;
2475
- const { tabs, suffix_index_product, hidden_tags, display } = response;
2476
- setAllowedTabs(tabs);
2477
- setSuffixIndexProduct(suffix_index_product);
2478
- setHiddenTags(hidden_tags);
2472
+ const { display } = response;
2479
2473
  setDisplaySettings(display);
2480
2474
  setSuggestionSettings((_a2 = display == null ? void 0 : display.search) == null ? void 0 : _a2.suggestion);
2481
2475
  await handleMultiSearch(response);
@@ -2870,12 +2864,13 @@ const SearchResultWidget = (props) => {
2870
2864
  React__default.useEffect(() => {
2871
2865
  console.log("useEffect running");
2872
2866
  console.log("previousState", previousState);
2873
- if (!(isRenderApp == null ? void 0 : isRenderApp.instantSearch))
2874
- return;
2875
- const searchParams2 = new URLSearchParams(document.location.search);
2876
- setKeyword((searchParams2 == null ? void 0 : searchParams2.get(queryKeyword)) || "");
2877
- handleSettings(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING) || "");
2878
- }, [isRenderApp]);
2867
+ setTimeout(() => {
2868
+ const searchParams2 = new URLSearchParams(document.location.search);
2869
+ setKeyword((searchParams2 == null ? void 0 : searchParams2.get(queryKeyword)) || "");
2870
+ handleSettings(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING) || "");
2871
+ console.log("setTimeout");
2872
+ }, 1500);
2873
+ }, []);
2879
2874
  React__default.useEffect(() => {
2880
2875
  if (Boolean(previousState && (previousState == null ? void 0 : previousState.keyword) !== keyword) && layoutType === "default") {
2881
2876
  const INSTANT_SEARCH_SETTING = JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING) || "");
@@ -4022,11 +4017,8 @@ const SearchWidget = (props) => {
4022
4017
  });
4023
4018
  const [isLoading, setIsLoading] = React__default.useState(true);
4024
4019
  const [keyword, setKeyword] = React__default.useState("");
4025
- const [suffixIndexProduct, setSuffixIndexProduct] = React__default.useState("");
4026
4020
  const [searchResultProduct, setSearchResultProduct] = React__default.useState([]);
4027
4021
  const [searchResultOther, setSearchResultOther] = React__default.useState([]);
4028
- const [allowedTabs, setAllowedTabs] = React__default.useState([]);
4029
- const [hiddenTags, setHiddenTags] = React__default.useState([]);
4030
4022
  const [displaySettings, setDisplaySettings] = React__default.useState({});
4031
4023
  const [suggestionSettings, setSuggestionSettings] = React__default.useState({});
4032
4024
  const [suggestionIndex, setSuggestionIndex] = React__default.useState("");
@@ -4095,10 +4087,7 @@ const SearchWidget = (props) => {
4095
4087
  response = JSON.parse(LOCAL_STORAGE_INSTANT_SEARCH_SETTING);
4096
4088
  if (!response)
4097
4089
  return;
4098
- const { tabs, suffix_index_product, hidden_tags, display } = response;
4099
- setAllowedTabs(tabs);
4100
- setSuffixIndexProduct(suffix_index_product);
4101
- setHiddenTags(hidden_tags);
4090
+ const { display } = response;
4102
4091
  setDisplaySettings(display);
4103
4092
  setSuggestionSettings((_a2 = display == null ? void 0 : display.search) == null ? void 0 : _a2.suggestion);
4104
4093
  await handleMultiSearch(response);