Skip to content

Commit afef252

Browse files
author
Juan Mora
committed
Add validation to accept special purposes only vendors
1 parent 81d39d2 commit afef252

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

modules/core/src/encoder/SemanticPreEncoder.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,12 @@ export class SemanticPreEncoder {
4141
if (value) {
4242

4343
const vendor = gvl.vendors[vendorId];
44+
const isInactive = !vendor || vendor.deletedDate;
45+
const isSpecialPurposesOnly = !isInactive
46+
? vendor['purposes'].length === 0 && vendor['legIntPurposes'].length === 0 && vendor['specialPurposes'].length > 0
47+
: false;
4448

45-
if (!vendor || vendor.deletedDate) {
49+
if (isInactive) {
4650

4751
/**
4852
* If the vendor doesn't exist, then they should not receive a
@@ -127,6 +131,15 @@ export class SemanticPreEncoder {
127131

128132
}
129133

134+
/**
135+
* As special purposes have a special treatment and cannot being objected,
136+
* these special purposes only vendors need to set LI signal when present
137+
*/
138+
139+
if (gvlVendorKey === 'legIntPurposes' && isSpecialPurposesOnly && !isInactive) {
140+
vector.set(vendorId);
141+
}
142+
130143
}
131144

132145
});

0 commit comments

Comments
 (0)