Commit c83503c
refactor(pixel): use consent capability queries in Pixel
Replace 5 consent string comparisons in pixel.ts with calls to
consentAllowsTracking() from core:
- init(): level !== 'none' → consentAllowsTracking(level)
- setConsent(): level !== 'none' → consentAllowsTracking(level)
- startCmpDetection() onUpdate: level !== 'none' → consentAllowsTracking
- startCmpDetection() onDetected: detector.level !== 'none' → same
- canTrack(): level !== 'none' → consentAllowsTracking(level)
The earlier version of pixel.ts had userId/identify checks that needed
includesUserId() and canIdentify(), but those were removed in PR #2846
(pixel identify removal). Only canTrack() is needed now.
Update pixel.test.ts mock to include the canTrack export.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent e3aceea commit c83503c
2 files changed
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
127 | | - | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
171 | | - | |
| 172 | + | |
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
| |||
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
203 | | - | |
| 204 | + | |
204 | 205 | | |
205 | 206 | | |
206 | 207 | | |
| |||
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
213 | | - | |
| 214 | + | |
214 | 215 | | |
215 | 216 | | |
216 | 217 | | |
| |||
338 | 339 | | |
339 | 340 | | |
340 | 341 | | |
341 | | - | |
| 342 | + | |
342 | 343 | | |
343 | 344 | | |
344 | 345 | | |
| |||
0 commit comments