Skip to content

Commit bcb33f1

Browse files
committed
accept a function to check for cookie consent
1 parent 5532f36 commit bcb33f1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,11 @@ var client = function(sitekey, privatekey) {
243243
return;
244244
}
245245

246-
if (!cookie.checkCookie()) {
246+
if (!cookie.checkCookie() || !options || !options.checkCookieConsentFunction) {
247+
return;
248+
}
249+
250+
if (typeof options.checkCookieConsentFunction != 'function' || !options.checkCookieConsentFunction.call()) {
247251
return;
248252
}
249253

0 commit comments

Comments
 (0)