Skip to content

Commit

Permalink
Allow for passing initial view state via data parameter (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfarrell76 committed Aug 1, 2024
1 parent 777d10c commit b9cfa6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/transcend-io/consent-manager-ui.git"
},
"homepage": "https://github.com/transcend-io/consent-manager-ui",
"version": "4.15.1",
"version": "4.16.0",
"license": "MIT",
"main": "build/ui",
"files": [
Expand Down
5 changes: 5 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ export function getMergedConfig(): MergedConsentManagerConfig {
config.secondaryPolicy ??= secondaryPolicy;
config.dismissedViewState ??= dismissedViewState;
config.languages ??= languages;
if (typeof config.initialViewStateByPrivacyRegime === 'string') {
config.initialViewStateByPrivacyRegime = JSON.parse(
config.initialViewStateByPrivacyRegime,
);
}

// Determine the language settings to use
const existingLanguages = config.languages
Expand Down

0 comments on commit b9cfa6f

Please sign in to comment.