sr-npm 1.7.141 → 1.7.142

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.141",
3
+ "version": "1.7.142",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -260,8 +260,33 @@ async function updateCount(_$w) {
260
260
  }
261
261
 
262
262
  async function handleDepartmentParam(_$w,department) {
263
- console.log("department inside handleDepartmentParam", department.replace('-', ' '));
264
- _$w('#dropdownDepartment').value = department.replace('-', ' ');
263
+ const departmentValue = department.replace('-', ' ');
264
+ console.log("department inside handleDepartmentParam", departmentValue);
265
+
266
+ // Debug: Check dropdown options
267
+ const dropdownOptions = _$w('#dropdownDepartment').options;
268
+ console.log("dropdown options:", dropdownOptions);
269
+
270
+ // Try setting the value
271
+ _$w('#dropdownDepartment').value = departmentValue;
272
+ console.log("after setting, dropdown value:", _$w('#dropdownDepartment').value);
273
+
274
+ // If value didn't set, try finding exact match
275
+ if (!_$w('#dropdownDepartment').value) {
276
+ const matchingOption = dropdownOptions.find(option =>
277
+ option.label.toLowerCase() === departmentValue.toLowerCase() ||
278
+ option.value.toLowerCase() === departmentValue.toLowerCase()
279
+ );
280
+
281
+ if (matchingOption) {
282
+ console.log("found matching option:", matchingOption);
283
+ _$w('#dropdownDepartment').value = matchingOption.value;
284
+ console.log("after setting matching option, dropdown value:", _$w('#dropdownDepartment').value);
285
+ } else {
286
+ console.log("no matching option found for:", departmentValue);
287
+ }
288
+ }
289
+
265
290
  console.log("before applyFilters_$w('#dropdownDepartment').value", _$w('#dropdownDepartment').value);
266
291
 
267
292
  await applyFilters(_$w, true); // Skip URL update since we're handling initial URL params