fix: don't show analytics dialog if the user is a crawler

This commit is contained in:
madkarmaa
2025-05-31 20:04:01 +02:00
parent 4cc473b43e
commit 5afa5f29af
2 changed files with 7 additions and 1 deletions

5
src/lib/utils.ts Normal file

File diff suppressed because one or more lines are too long

View File

@@ -26,6 +26,7 @@
import { RV_GOOGLE_TAG_MANAGER_ID } from '$env/static/public';
import FooterHost from '$layout/Footer/FooterHost.svelte';
import { isCrawler } from '$lib/utils';
const queryClient = new QueryClient({
defaultOptions: {
@@ -66,7 +67,7 @@
allowAnalytics = localStorage.getItem('analytics') === 'true';
if (allowAnalytics) enableAnalytics();
} else {
showConsentModal = true;
showConsentModal = !isCrawler(navigator.userAgent);
}
new DateTriggerEventHandler(themeEvents);