diff --git a/CHANGELOG.md b/CHANGELOG.md index e10a8c9f..c9539e1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to - ✨(frontend) integrate configurable Waffle #1795 - ✨ Import of documents #1609 - 🚨(CI) gives warning if theme not updated #1811 +- ✨(frontend) Add stat from Crisp #1824 - ✨(auth) add silent login #1690 - 🔧(project) add DJANGO_EMAIL_URL_APP environment variable #1825 diff --git a/src/frontend/apps/impress/src/core/config/ConfigProvider.tsx b/src/frontend/apps/impress/src/core/config/ConfigProvider.tsx index 09952f81..a318c66b 100644 --- a/src/frontend/apps/impress/src/core/config/ConfigProvider.tsx +++ b/src/frontend/apps/impress/src/core/config/ConfigProvider.tsx @@ -12,7 +12,7 @@ import { useSynchronizedLanguage, } from '@/features/language'; import { useAnalytics } from '@/libs'; -import { CrispProvider, PostHogAnalytic } from '@/services'; +import { CrispAnalytic, PostHogAnalytic } from '@/services'; import { useSentryStore } from '@/stores/useSentryStore'; import { useConfig } from './api/useConfig'; @@ -73,6 +73,14 @@ export const ConfigProvider = ({ children }: PropsWithChildren) => { new PostHogAnalytic(conf.POSTHOG_KEY); }, [conf?.POSTHOG_KEY]); + useEffect(() => { + if (!conf?.CRISP_WEBSITE_ID) { + return; + } + + new CrispAnalytic({ websiteId: conf.CRISP_WEBSITE_ID }); + }, [conf?.CRISP_WEBSITE_ID]); + if (!conf) { return ( @@ -91,11 +99,7 @@ export const ConfigProvider = ({ children }: PropsWithChildren) => { {conf?.FRONTEND_JS_URL && (