message: Move logic to set LI in specialPurposes only inside current validations
diff: @@ -41,12 +41,8 @@ export class SemanticPreEncoder {
  if (value) {
  const vendor = gvl.vendors[vendorId];
  - const isInactive = !vendor || vendor.deletedDate;
  - const isSpecialPurposesOnly = !isInactive
  - ? vendor['purposes'].length === 0 && vendor['legIntPurposes'].length === 0 && vendor['specialPurposes'].length > 0
  - : false;
  - if (isInactive) {
  + if (!vendor || vendor.deletedDate) {
  /**
  * If the vendor doesn't exist, then they should not receive a
  @@ -57,6 +53,18 @@ export class SemanticPreEncoder {
  } else if (vendor[gvlVendorKey].length === 0) {
  + // Define if the current vendor is special purposes only
  + const isSpecialPurposesOnly = vendor['purposes'].length === 0 && vendor['legIntPurposes'].length === 0 && vendor['specialPurposes'].length > 0;
  +
  + if (gvlVendorKey === 'legIntPurposes' && isSpecialPurposesOnly) {
  +
  + /**
  + * As special purposes have a special treatment and cannot being objected,
  + * these special purposes only vendors need to set LI signal when present
  + */
  +
  + } else {
  +
  /**
  * If the vendor does exist, but they haven't declared any
  * purposes for this legal basis, then we need to see if they can
  @@ -131,13 +139,6 @@ export class SemanticPreEncoder {
  }
  - /**
  - * As special purposes have a special treatment and cannot being objected,
  - * these special purposes only vendors need to set LI signal when present
  - */
  -
  - if (gvlVendorKey === 'legIntPurposes' && isSpecialPurposesOnly && !isInactive) {
  - vector.set(vendorId);
  }
  }
  