Update frontend/src/index.tsx

Co-authored-by: James Brunton <jbrunton96@gmail.com>
This commit is contained in:
ConnorYoh 2025-08-29 13:58:59 +01:00 committed by GitHub
parent b6b6d41800
commit 342889022c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,7 +30,7 @@ posthog.init(import.meta.env.VITE_PUBLIC_POSTHOG_KEY, {
opt_out_capturing_by_default: false, // We handle opt-out via cookie consent
});
function UpdatePosthogConsent(){
function updatePosthogConsent(){
if(typeof(posthog) == "undefined") {
return;
}
@ -41,8 +41,8 @@ function UpdatePosthogConsent(){
console.log("Updated analytics consent: ", optIn? "opted in" : "opted out");
}
window.addEventListener("cc:onConsent", UpdatePosthogConsent);
window.addEventListener("cc:onChange", UpdatePosthogConsent);
window.addEventListener("cc:onConsent", updatePosthogConsent);
window.addEventListener("cc:onChange", updatePosthogConsent);
const container = document.getElementById('root');
if (!container) {