@nuskin/react-search-sdk 1.0.0-comx-2233.2 → 1.0.0-comx-2233.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.
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -337,17 +337,13 @@ function createSearchService(options = {}) {
|
|
|
337
337
|
if (!trimmedQuery) return void 0;
|
|
338
338
|
addRecentHeaderSearch(localeParts, trimmedQuery, storage);
|
|
339
339
|
const optionHref = resolveOptionHref(option, localeParts);
|
|
340
|
-
if (optionHref
|
|
341
|
-
locationLike.assign(optionHref);
|
|
340
|
+
if (optionHref) {
|
|
342
341
|
return stripLocalePrefix(optionHref, localeParts);
|
|
343
342
|
}
|
|
344
343
|
const targetPath = buildSearchResultsPath(
|
|
345
344
|
trimmedQuery,
|
|
346
345
|
localeParts
|
|
347
346
|
);
|
|
348
|
-
if (locationLike && typeof locationLike.assign === "function") {
|
|
349
|
-
locationLike.assign(targetPath);
|
|
350
|
-
}
|
|
351
347
|
return stripLocalePrefix(targetPath, localeParts);
|
|
352
348
|
},
|
|
353
349
|
activateSuggestionAction(option) {
|
|
@@ -360,9 +356,7 @@ function createSearchService(options = {}) {
|
|
|
360
356
|
option,
|
|
361
357
|
localeParts
|
|
362
358
|
);
|
|
363
|
-
if (optionHref2
|
|
364
|
-
locationLike.assign(optionHref2);
|
|
365
|
-
} else {
|
|
359
|
+
if (!optionHref2) {
|
|
366
360
|
const optionQuery2 = option?.value ?? option?.label ?? option?.identifier ?? "";
|
|
367
361
|
service.submitProductSearch(
|
|
368
362
|
String(optionQuery2)
|
|
@@ -381,9 +375,8 @@ function createSearchService(options = {}) {
|
|
|
381
375
|
}
|
|
382
376
|
}
|
|
383
377
|
const optionHref = resolveOptionHref(option, localeParts);
|
|
384
|
-
if (optionHref
|
|
385
|
-
|
|
386
|
-
return optionHref;
|
|
378
|
+
if (optionHref) {
|
|
379
|
+
return stripLocalePrefix(optionHref, localeParts);
|
|
387
380
|
}
|
|
388
381
|
const optionQuery = option?.value ?? option?.label ?? option?.identifier ?? "";
|
|
389
382
|
return service.submitProductSearch(String(optionQuery));
|