Skip to content

Commit

Permalink
Rm/update default feature label (#243)
Browse files Browse the repository at this point in the history
* update default audience

* update audience name
  • Loading branch information
renz-maban authored Jul 17, 2024
1 parent 4f67293 commit 835cf57
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/kits/incito-publication/bootstrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,25 @@ export default class Bootstrapper {
}

getFeatureLabels() {
const regex = new RegExp(/audience=[^#&;+]+/);
const regex = new RegExp(/tjek-audience=[^#&;+]+/);
const match = regex.exec(location.href) || [];
let feature;

if (match.length > 0) {
feature =
match[0] !== undefined
? match[0].replace('audience=', '').split(',')
: [];
} else if (localStorage.getItem('audience') !== null) {
feature = localStorage.getItem('audience')?.split(',') || [];
? match[0].replace('tjek-audience=', '').split(',')
: ['none'];
} else if (localStorage.getItem('tjek-audience') !== null) {
feature = localStorage.getItem('tjek-audience')?.split(',') || [
'none'
];
} else {
const cookie = regex.exec(document.cookie) || [];
feature =
cookie[0] !== undefined
? cookie[0].replace('audience=', '').split(',')
: [];
? cookie[0].replace('tjek-audience=', '').split(',')
: ['none'];
}

return feature;
Expand Down

0 comments on commit 835cf57

Please sign in to comment.