From 605c3457ff9239816cbb60f159dc31a80415ee34 Mon Sep 17 00:00:00 2001 From: Nevo David Date: Wed, 30 Oct 2024 22:59:37 +0700 Subject: [PATCH] feat: fix posthog --- apps/frontend/src/app/layout.tsx | 2 +- .../react-shared-libraries/src/helpers/posthog.tsx | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/frontend/src/app/layout.tsx b/apps/frontend/src/app/layout.tsx index 4f48fed8..c645acad 100644 --- a/apps/frontend/src/app/layout.tsx +++ b/apps/frontend/src/app/layout.tsx @@ -46,7 +46,7 @@ export default async function AppLayout({ children }: { children: ReactNode }) { domain={!!process.env.IS_GENERAL ? 'postiz.com' : 'gitroom.com'} > {children} diff --git a/libraries/react-shared-libraries/src/helpers/posthog.tsx b/libraries/react-shared-libraries/src/helpers/posthog.tsx index 18164ed7..08e4e9f8 100644 --- a/libraries/react-shared-libraries/src/helpers/posthog.tsx +++ b/libraries/react-shared-libraries/src/helpers/posthog.tsx @@ -6,22 +6,22 @@ import { FC, ReactNode, useEffect } from 'react'; export const PHProvider: FC<{ children: ReactNode; - key?: string; + phkey?: string; host?: string; -}> = ({ children, key, host }) => { +}> = ({ children, phkey, host }) => { useEffect(() => { - if (!key || !host) { + if (!phkey || !host) { return; } - posthog.init(key, { + posthog.init(phkey, { api_host: host, person_profiles: 'identified_only', capture_pageview: false, // Disable automatic pageview capture, as we capture manually }); }, []); - if (!key || !host) { + if (!phkey || !host) { return <>{children}; } return {children};