fix cookie consent status

This commit is contained in:
rustdesk 2024-10-15 00:50:19 +08:00
parent fdc0973f15
commit afdc36f199
2 changed files with 1 additions and 2 deletions

View File

@ -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';
}

View File

@ -25,6 +25,7 @@ export const config: CookieConsentConfig = {
'<a href="https://marketingplatform.google.com/about/analytics/terms/us/" target="_blank">Google Analytics 4 (dummy)</a>',
onAccept: () => {
// TODO: load ga4
localStorage.setItem('cookie-accepted', 'true');
},
onReject: () => {
console.log('ga4 rejected');