Skip to content

Commit

Permalink
Respect permutive switch for prepare-permutive (#1629)
Browse files Browse the repository at this point in the history
* Respect permutive switch for prepare-permutive

* Changeset
  • Loading branch information
arelra authored Oct 17, 2024
1 parent 9b36b3e commit df13e8c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/angry-boats-relax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@guardian/commercial': minor
---

Respect permutive switch for prepare-permutive
7 changes: 6 additions & 1 deletion src/init/consented/prepare-permutive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ const runPermutive = (
* https://permutive.com/audience-platform/publishers/
* @returns Promise
*/
export const initPermutive = (): Promise<void> => {
const initPermutiveSegmentation = () => {
/* eslint-disable -- permutive code */
// From here until we re-enable eslint is the Permutive code
// that we received from them.
Expand Down Expand Up @@ -237,7 +237,12 @@ export const initPermutive = (): Promise<void> => {
ophan: window.guardian.config.ophan,
};
runPermutive(permutiveConfig, window.permutive);
};

export const initPermutive = () => {
if (window.guardian.config.switches.permutive) {
void initPermutiveSegmentation();
}
return Promise.resolve();
};

Expand Down

0 comments on commit df13e8c

Please sign in to comment.