Skip to content

Commit

Permalink
Merge pull request #53 from punktDeForks/bugfix/prevent-double-call-t…
Browse files Browse the repository at this point in the history
…o-api

BUGFIX: adjust conditions to prevent double insert of script
  • Loading branch information
Nikdro authored Nov 3, 2023
2 parents e22d78f + a5a38b1 commit 7c0b705
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion Resources/Public/JavaScript/Initialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function loadCookiebannerHtml(openSettings, showImmediately, openedManually)
}
});
}
console.log(autoAccept);

if (showImmediately === false && KD_GDPR_CC.hideBeforeInteraction) {
window.addEventListener(
Expand Down
8 changes: 2 additions & 6 deletions Resources/Public/JavaScript/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,9 @@ function initializeCookieConsent(openSettings, openedManually, autoAccept = 'non

if (openSettings === true) {
btnIndividualSettingsEnable.dispatchEvent(clickEvent);
}

if (openedManually !== true && autoAccept === 'all') {
} else if (openedManually !== true && autoAccept === 'all') {
btnAcceptAll.dispatchEvent(clickEvent);
}

if (
} else if (
openedManually !== true
&& (typeof KD_GDPR_CC_ACCEPT_NECESSARY !== 'undefined' && KD_GDPR_CC_ACCEPT_NECESSARY === true
|| autoAccept === 'necessary')
Expand Down

0 comments on commit 7c0b705

Please sign in to comment.