fix(core): update
This commit is contained in:
@ -46,7 +46,7 @@ export class CsWebclient {
|
||||
return true;
|
||||
}
|
||||
|
||||
public async getAndRunConsentTuples() {
|
||||
public async getAndRunConsentTuples(domainArg?: string) {
|
||||
const acceptedCookieLevels = await this.getCookieLevels();
|
||||
if (!acceptedCookieLevels) {
|
||||
console.log('You need to set accepted cookielevels first');
|
||||
@ -55,8 +55,9 @@ export class CsWebclient {
|
||||
const csGetDomainSettingsRequest = new plugins.typedrequest.TypedRequest<
|
||||
plugins.csInterfaces.IRequest_Client_ConsentSoftwareServer_GetDomainSettings
|
||||
>('https://connect.api.global/consentsoftware', 'getDomainSettings');
|
||||
const domainToRequest = domainArg || window.location.hostname;
|
||||
const response = await csGetDomainSettingsRequest.fire({
|
||||
domain: window.location.hostname
|
||||
domain: domainToRequest
|
||||
});
|
||||
for (const consentTuple of response.consentTuples) {
|
||||
if (consentTuple.level === 'functional' || acceptedCookieLevels.includes(consentTuple.level)) {
|
||||
|
Reference in New Issue
Block a user