From afdc36f1993a30cab141a686f24c0cc437676776 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Tue, 15 Oct 2024 00:50:19 +0800 Subject: [PATCH] fix cookie consent status --- v3/src/components/CookieConsent.astro | 2 -- v3/src/components/CookieConsentConfig.ts | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/v3/src/components/CookieConsent.astro b/v3/src/components/CookieConsent.astro index dd574a7..912e892 100644 --- a/v3/src/components/CookieConsent.astro +++ b/v3/src/components/CookieConsent.astro @@ -12,8 +12,6 @@ import '../assets/styles/ccElegantBlack.css'; document.body.classList.add('cc--elegant-black'); function checkCookieConsent() { - // this cookie consent use cookie to store the consent status, but our webiste v2 use localStorage - // this is used to compliant with v2 const consentStatus = localStorage.getItem('cookie-accepted'); return consentStatus === 'true'; } diff --git a/v3/src/components/CookieConsentConfig.ts b/v3/src/components/CookieConsentConfig.ts index 1b05a36..04857c4 100644 --- a/v3/src/components/CookieConsentConfig.ts +++ b/v3/src/components/CookieConsentConfig.ts @@ -25,6 +25,7 @@ export const config: CookieConsentConfig = { 'Google Analytics 4 (dummy)', onAccept: () => { // TODO: load ga4 + localStorage.setItem('cookie-accepted', 'true'); }, onReject: () => { console.log('ga4 rejected');