📈(frontend) check if analytic is enabled

Few frontend features rely on Posthog. Posthog is not activated in
dev environment. Offer a hook that encapsulates this logic, and
return a boolean flag.
This commit is contained in:
lebaudantoine
2024-12-03 22:17:51 +01:00
committed by aleb_the_flash
parent 7ce4390740
commit 3902b02691

View File

@@ -0,0 +1,6 @@
import { useConfig } from '@/api/useConfig.ts'
export const useIsAnalyticsEnabled = () => {
const { data } = useConfig()
return !!data?.analytics?.id
}