@usereactify/search 3.4.0 → 3.4.3
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.
|
@@ -21,8 +21,12 @@ const useLiveConfig = (shopifyPermanentDomain) => {
|
|
|
21
21
|
// synchronously returns cached and non-expired config from session storage
|
|
22
22
|
const cachedConfig = react_1.default.useMemo(() => {
|
|
23
23
|
var _a;
|
|
24
|
+
if (typeof window === "undefined") {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
24
27
|
// skip checking cache if url search param "nocache" is set
|
|
25
|
-
const skipCache = new URLSearchParams(window.location.href.split("?")[1]).get("nocache") !==
|
|
28
|
+
const skipCache = new URLSearchParams(window.location.href.split("?")[1]).get("nocache") !==
|
|
29
|
+
null;
|
|
26
30
|
if (skipCache) {
|
|
27
31
|
debug("skipping cache");
|
|
28
32
|
return;
|
package/dist/hooks/useSort.d.ts
CHANGED
package/dist/provider.d.ts
CHANGED
|
@@ -11,9 +11,10 @@ const SensorSearch = () => {
|
|
|
11
11
|
const { fields } = (0, hooks_1.useConfig)();
|
|
12
12
|
const { searchQuery } = (0, hooks_1.useSearch)();
|
|
13
13
|
// ignore search fields only set for instant search
|
|
14
|
-
const searchFields = react_1.default.useMemo(() => fields.filter((field) => ["always_search", "search_page"].includes(field.searchType)), []);
|
|
15
|
-
if (!searchQuery)
|
|
14
|
+
const searchFields = react_1.default.useMemo(() => fields.filter((field) => ["always_search", "search_page"].includes(field.searchType)), [fields]);
|
|
15
|
+
if (!searchQuery || !searchFields.length) {
|
|
16
16
|
return null;
|
|
17
|
+
}
|
|
17
18
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
18
19
|
react_1.default.createElement(DataSearch_1.default, { fuzziness: 1, queryFormat: "and", autosuggest: false, value: searchQuery, componentId: "SensorSearch", style: { display: "none" }, dataField: searchFields.map((field) => field.field), fieldWeights: searchFields.map((field) => field.importance), customQuery: (value, props) => {
|
|
19
20
|
const { dataField, fieldWeights } = props;
|