@sinequa/atomic-angular 1.6.1 → 1.6.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.
@@ -4470,9 +4470,11 @@ class PreviewService {
4470
4470
  getEntityId(entity, value, index) {
4471
4471
  if (!this.previewData)
4472
4472
  return undefined;
4473
- // Combine filters for better performance
4473
+ // Combine filters for better performance.
4474
+ // NB: positionInCategories[entity] is a zero-based index, so the first occurrence is 0.
4475
+ // Use a presence check (not truthiness) to avoid dropping that first occurrence.
4474
4476
  const entitySearched = this.previewData.highlightsPerLocation
4475
- .filter((item) => item.positionInCategories[entity] && item.values.some((v) => v === value))
4477
+ .filter((item) => item.positionInCategories[entity] !== undefined && item.values.some((v) => v === value))
4476
4478
  .map((e) => ({ id: e.positionInCategories[entity] }));
4477
4479
  const id = entitySearched[index]?.id;
4478
4480
  return id;