sr-npm 1.7.288 → 1.7.290

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.288",
3
+ "version": "1.7.290",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -338,22 +338,34 @@ async function handleLocationParam(_$w,location) {
338
338
  console.log("location dropdown options:", dropdownOptions);
339
339
  const optionsFromCMS=await wixData.query("cities").find();
340
340
  //+1 because of the "All" option
341
- console.log("i am here####################")
342
341
  if(dropdownOptions.length!==optionsFromCMS.items.length+1){
343
342
  fixDropdownOptions('#dropdownLocation',optionsFromCMS, _$w);
344
343
  }
345
344
  console.log("dropdown options after fix: ", _$w('#dropdownLocation').options);
346
345
 
346
+ let appliedFilter=false;
347
+ let checkme;
348
+ console.log("location value is: ", locationValue);
347
349
  if (_$w('#dropdownLocation').options.find(option => option.value.toLowerCase() === locationValue.toLowerCase()))
348
350
  {
349
- _$w('#dropdownLocation').value = locationValue;
350
- console.log("i am here!@@##!@#")
351
- await applyFilters(_$w, true); // Skip URL update since we're handling initial URL params
351
+ checkme=option;
352
352
  }
353
- else{
354
- console.warn("location value not found in dropdown options");
355
- queryParams.remove(["location" ]);
353
+ console.log("checkme is: ", checkme);
354
+
356
355
 
356
+ _$w('#dropdownLocation').options.find(async (option) =>
357
+ {
358
+ if (option.value.toLowerCase() === locationValue.toLowerCase()){
359
+ appliedFilter=true;
360
+ console.log("option value is: ", option);
361
+ _$w('#dropdownLocation').value = option.value;
362
+ console.log("i am here!@@##!@#")
363
+ await applyFilters(_$w, true); // Skip URL
364
+ }
365
+ })
366
+ if (!appliedFilter) {
367
+ console.warn("location value not found in dropdown options");
368
+ queryParams.remove(["location"]);
357
369
  }
358
370
 
359
371
  }