handle string-json in cookie script

This commit is contained in:
Deborah Barnard
2022-11-24 10:14:04 +00:00
parent c7c3d3ae49
commit 64fa8a8aff

View File

@@ -11,7 +11,8 @@ if (docsConsent && docsConsent.analytics === true) {
// If the user already has the n8n-consent cookie, accept cookies in docs as well
let n8nCookieConsent = getCookie("n8n-consent");
console.log("cs1 " + n8nCookieConsent);
console.log(typeOf(n8nCookieConsent));
n8nCookieConsent = JSON.parse(n8nCookieConsent);
if(n8nCookieConsent && n8nCookieConsent === true) {
console.log("cs2 " + n8nCookieConsent);
__md_set("__consent", {"analytics": true})