Skip to content

Commit 056c131

Browse files
committed
extra check
1 parent 2b6e955 commit 056c131

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

static/main.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ function setupSettings(hub) {
100100
return currentSettings;
101101
}
102102

103+
function hasCookieConsented(options) {
104+
return jsCookie.get(options.policies.cookies.key) === options.policies.cookies.hash;
105+
}
106+
103107
function setupButtons(options) {
104108
var alertSystem = new Alert();
105109

@@ -117,9 +121,7 @@ function setupButtons(options) {
117121
}
118122
});
119123
}
120-
var hasCookieConsented = function () {
121-
return jsCookie.get(options.policies.cookies.key) === options.policies.cookies.hash;
122-
};
124+
123125
if (options.policies.cookies.enabled) {
124126
var getCookieTitle = function () {
125127
return 'Cookies & related technologies policy<br><p>Current consent status: <span style="color:' +
@@ -225,7 +227,7 @@ function initPolicies(options) {
225227
if (options.policies.cookies.enabled && storedCookieConsent !== '' &&
226228
options.policies.cookies.hash !== storedCookieConsent) {
227229
simpleCooks.show();
228-
} else if (options.policies.cookies.enabled) {
230+
} else if (options.policies.cookies.enabled && hasCookieConsented(options)) {
229231
analytics.initialise();
230232
}
231233
}

0 commit comments

Comments
 (0)