mirror of
https://github.com/XFox111/my-website.git
synced 2026-04-22 07:28:01 +03:00
fix: cookie consent tracking breaks when CDN caching is involved
This commit is contained in:
@@ -12,11 +12,14 @@ const CookieBanner: React.FC<{ askForConsent: boolean; }> = props =>
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
if (navigator.doNotTrack === "1")
|
||||
return;
|
||||
|
||||
const choice = getCookieChoice();
|
||||
setVisible(choice === "none");
|
||||
|
||||
// Since Clarity cookies expiration dates extend well beyond 60 days,
|
||||
// we need to terminate them manually once our consent tracking cookie expires.
|
||||
// we need to terminate them manually once our consent tracking cookie expired.
|
||||
if (choice !== "accepted")
|
||||
window.clarity?.("consent", false);
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user