sr-npm 1.7.1149 → 1.7.1151

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.1149",
3
+ "version": "1.7.1151",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -475,7 +475,8 @@ function getValueFromValueId(valueIds, value) {
475
475
  clearAll?_$w(`#${FiltersIds[fieldTitle]}CheckBox`).value=[]:_$w(`#${FiltersIds[fieldTitle]}CheckBox`).value = visibleSet
476
476
  if(visibleSet.size>0) {
477
477
  let selectedindices=[];
478
- for(const value of visibleSet) {
478
+ for(const [key, values] of selectedByField.entries()) {
479
+ for (const value of values) {
479
480
  const options = optionsByFieldId.get(fieldId) || [];
480
481
  const option = getCorrectOption(value,options,fieldTitle);
481
482
  if(option) {
@@ -483,6 +484,7 @@ function getValueFromValueId(valueIds, value) {
483
484
  selectedindices.push(optionIndex);
484
485
  }
485
486
  }
487
+ }
486
488
  _$w(`#${FiltersIds[fieldTitle]}CheckBox`).selectedIndices = selectedindices;
487
489
  }
488
490
  }
@@ -599,6 +601,12 @@ async function refreshFacetCounts(_$w,clearAll=false) {
599
601
  counter.set(option.value, (counter.get(option.value) || 0) + 1);
600
602
  }
601
603
  }
604
+ for (const value of selectedByField.get(fieldId)) {
605
+ if(countsByFieldId.get(fieldId).get(value)===undefined)
606
+ {
607
+ counter.set(value, 0);
608
+ }
609
+ }
602
610
  }
603
611
  countsByFieldId.set(fieldId, counter);
604
612
  }