π¨ The ultimate agentic social media scheduling tool π€
TypeScript nextjsopen-sourceopen-source-social-media-scheduling-toolosspostiz-cloudpostiz-hostedredisscheduling-toolsocial-media-scheduling-tooltypescript
feat: fix posthog
Nevo David605c3457ff92
diff --git a/apps/frontend/src/app/layout.tsx b/apps/frontend/src/app/layout.tsxindex 4f48fed87..c645acad0 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'}><PHProvider- key={process.env.NEXT_PUBLIC_POSTHOG_KEY}+ phkey={process.env.NEXT_PUBLIC_POSTHOG_KEY}host={process.env.NEXT_PUBLIC_POSTHOG_HOST}><LayoutContext>{children}</LayoutContext>diff --git a/libraries/react-shared-libraries/src/helpers/posthog.tsx b/libraries/react-shared-libraries/src/helpers/posthog.tsxindex 18164ed71..08e4e9f80 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 <PostHogProvider client={posthog}>{children}</PostHogProvider>;