@akropolys/kiku 1.5.3 → 1.5.5

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.js CHANGED
@@ -2307,7 +2307,7 @@ function SparkleModal({
2307
2307
  const client = (0, import_sdk7.useAkropolysContext)();
2308
2308
  const [fetchedProduct, setFetchedProduct] = (0, import_react6.useState)(null);
2309
2309
  const displayProduct = initialProduct || fetchedProduct;
2310
- const { results, loading: searchLoading, search } = (0, import_sdk7.useSearch)();
2310
+ const { results, loading: searchLoading, search } = (0, import_sdk7.useSearch)({ type: "vector" });
2311
2311
  const { messages, sources, loading: chatLoading, error: chatError, send } = (0, import_sdk7.useKiku)();
2312
2312
  const [chatInput, setChatInput] = (0, import_react6.useState)("");
2313
2313
  const [isMobile, setIsMobile] = (0, import_react6.useState)(false);
@@ -2462,7 +2462,7 @@ Question: ${q}`;
2462
2462
  (() => {
2463
2463
  const similarProducts = results.filter(
2464
2464
  (r) => {
2465
- const isSameName = r.product.name.toLowerCase() === displayProduct?.name?.toLowerCase();
2465
+ const isSameName = !!(r.product.name && displayProduct?.name && r.product.name.toLowerCase() === displayProduct.name.toLowerCase());
2466
2466
  const isSameSlug = r.product.slug && displayProduct?.slug && r.product.slug.toLowerCase() === displayProduct.slug.toLowerCase();
2467
2467
  return !isSameName && !isSameSlug;
2468
2468
  }
@@ -2632,7 +2632,7 @@ Question: ${q}`;
2632
2632
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-sp-results", children: (() => {
2633
2633
  const similarProducts = results.filter(
2634
2634
  (r) => {
2635
- const isSameName = r.product.name.toLowerCase() === displayProduct?.name?.toLowerCase();
2635
+ const isSameName = !!(r.product.name && displayProduct?.name && r.product.name.toLowerCase() === displayProduct.name.toLowerCase());
2636
2636
  const isSameSlug = r.product.slug && displayProduct?.slug && r.product.slug.toLowerCase() === displayProduct.slug.toLowerCase();
2637
2637
  return !isSameName && !isSameSlug;
2638
2638
  }