From 5cc3d46997e32fe8bf78310f49bc6dc4bb280737 Mon Sep 17 00:00:00 2001 From: Victor Cavero Date: Mon, 7 Sep 2026 20:04:14 +0200 Subject: [PATCH] =?UTF-8?q?fix(consent):=20la=20medici=C3=B3n=20propia=20s?= =?UTF-8?q?iempre=20activa;=20rechazar=20marketing=20ya=20no=20recarga=20l?= =?UTF-8?q?a=20p=C3=A1gina?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude-Session: https://claude.ai/code/session_01UNZxBnD6dnMGEdbvBVwoS7 --- dashboard/src/lib/consent.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/dashboard/src/lib/consent.js b/dashboard/src/lib/consent.js index 0249f27..25230f3 100644 --- a/dashboard/src/lib/consent.js +++ b/dashboard/src/lib/consent.js @@ -116,7 +116,8 @@ export function setConsent(choice) { v: VERSION, ts: new Date().toISOString(), necessary: true, - analytics: !!choice.analytics, + // First-party measurement is always on (exempt); only marketing is a choice. + analytics: true, marketing: !!choice.marketing, }; try { @@ -125,12 +126,7 @@ export function setConsent(choice) { listeners.forEach((fn) => { try { fn(getConsent()); } catch (_) { /* ignore */ } }); - if (next.analytics && !before.analytics) { - applyConsent(); - } else if (!next.analytics && before.analytics) { - try { window.op && window.op('clear'); } catch (_) { /* ignore */ } - try { window.location.reload(); } catch (_) { /* ignore */ } - } + applyConsent(); return getConsent(); }