sr-npm 1.7.515 → 1.7.516

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.515",
3
+ "version": "1.7.516",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -496,20 +496,25 @@ async function updateMapMarkers(_$w){
496
496
 
497
497
  }
498
498
 
499
- async function handleBrandDropdown(_$w){
500
- const brands=await wixData.query(COLLECTIONS.BRANDS).find();
501
- const disableMultiBrand=await getTokenFromCMS(TOKEN_NAME.DISABLE_MULTI_BRAND)
502
- if(disableMultiBrand==='true'){
503
- console.log("disabling brand dropdown because disableMultiBrand is true");
504
- _$w('#dropdownBrand').hide();
499
+ async function handleBrandDropdown(_$w) {
500
+ const brands = await wixData.query(COLLECTIONS.BRANDS).find();
501
+ let disableMultiBrand;
502
+ try {
503
+ disableMultiBrand = await getTokenFromCMS(TOKEN_NAME.DISABLE_MULTI_BRAND);
504
+ } catch (e) {
505
+ if (e.message !== "[getTokenFromCMS], No disableMultiBrand found") throw e;
506
+ console.log("disableMultiBrand token wasn't found");
507
+
505
508
  }
506
- else{
507
- if(brands.items.length>1){
509
+ if (disableMultiBrand === 'true') {
510
+ console.log("hiding brand dropdown");
511
+ _$w('#dropdownBrand').hide();
512
+ } else if (brands.items.length > 1) {
508
513
  console.log("showing brand dropdown");
509
514
  _$w('#dropdownBrand').show();
510
515
  }
511
- }
512
516
  }
517
+
513
518
  module.exports = {
514
519
  careersPageOnReady,
515
520
  };