Skip to content

Commit

Permalink
OneTrust_CookieConesnt_Changes: changed CookieConsentFactory to a sta…
Browse files Browse the repository at this point in the history
…tic class
  • Loading branch information
ruchiramoitra committed Dec 22, 2021
1 parent 7475f9e commit 187b976
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,10 @@ class Analytics {
if (this.options.cookieConsentManager) {
// Call the cookie consent factory to initialise and return the type of cookie
// consent being set. For now we only support OneTrust.
this.cookieConsent = new CookieConsentFactory(response, this.options);
this.cookieConsent = CookieConsentFactory.initialize(
response,
this.options
);
}

// If cookie consent object is return we filter according to consents given by user
Expand Down
3 changes: 2 additions & 1 deletion cookieConsent/CookieConsentFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const cookieConsent = {
OneTrust: OneTrust.default,
};
class CookieConsentFactory {
constructor(sourceConfig, options) {
static initialize(sourceConfig, options) {
/**
*
* check which type of cookie consent manager needs to be called if enabled
Expand All @@ -31,6 +31,7 @@ class CookieConsentFactory {

// }
}
return null;
}
}

Expand Down

0 comments on commit 187b976

Please sign in to comment.