diff --git a/src/backend/routers/app_router.py b/src/backend/routers/app_router.py index f053808..5c240fc 100644 --- a/src/backend/routers/app_router.py +++ b/src/backend/routers/app_router.py @@ -32,5 +32,6 @@ async def get_app_config(): return { "coderUrl": os.getenv("CODER_URL", ""), "posthogKey": os.getenv("VITE_PUBLIC_POSTHOG_KEY", ""), - "posthogHost": os.getenv("VITE_PUBLIC_POSTHOG_HOST", "") + "posthogHost": os.getenv("VITE_PUBLIC_POSTHOG_HOST", ""), + "devMode": os.getenv("PAD_DEV_MODE", "false") == "true", } diff --git a/src/frontend/src/App.tsx b/src/frontend/src/App.tsx index a61fa25..977cdc9 100644 --- a/src/frontend/src/App.tsx +++ b/src/frontend/src/App.tsx @@ -52,7 +52,7 @@ export default function App() { }; useEffect(() => { - if (config?.posthogKey && config?.posthogHost) { + if (!config?.devMode && config?.posthogKey && config?.posthogHost) { initializePostHog({ posthogKey: config.posthogKey, posthogHost: config.posthogHost, diff --git a/src/frontend/src/hooks/useAppConfig.ts b/src/frontend/src/hooks/useAppConfig.ts index 5a52f95..db18e0f 100644 --- a/src/frontend/src/hooks/useAppConfig.ts +++ b/src/frontend/src/hooks/useAppConfig.ts @@ -4,6 +4,7 @@ interface AppConfig { coderUrl: string; posthogKey: string; posthogHost: string; + devMode: boolean; } const fetchAppConfig = async (): Promise => { @@ -31,6 +32,7 @@ export const useAppConfig = () => { gcTime: Infinity, // Renamed from cacheTime in v5 }); + console.log('data', data); return { config: data, isLoadingConfig: isLoading,