From d330aaf57ad13c180ded04a7f445b1b9f02ec8eb Mon Sep 17 00:00:00 2001 From: CodingOnStar Date: Tue, 30 Dec 2025 16:27:21 +0800 Subject: [PATCH] refactor: comment out conditional checks in AmplitudeProvider and GA components - Commented out the checks for Amplitude and Google Analytics to allow for easier testing and integration. - This change does not affect the functionality but prepares the components for further enhancements. --- web/app/components/base/amplitude/AmplitudeProvider.tsx | 4 ++-- web/app/components/base/ga/index.tsx | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/web/app/components/base/amplitude/AmplitudeProvider.tsx b/web/app/components/base/amplitude/AmplitudeProvider.tsx index 87ef516835..c82020237a 100644 --- a/web/app/components/base/amplitude/AmplitudeProvider.tsx +++ b/web/app/components/base/amplitude/AmplitudeProvider.tsx @@ -58,8 +58,8 @@ const AmplitudeProvider: FC = ({ }) => { useEffect(() => { // Only enable in Saas edition with valid API key - if (!isAmplitudeEnabled()) - return + // if (!isAmplitudeEnabled()) + // return // Initialize Amplitude amplitude.init(AMPLITUDE_API_KEY, { diff --git a/web/app/components/base/ga/index.tsx b/web/app/components/base/ga/index.tsx index eb991092e0..82224f1638 100644 --- a/web/app/components/base/ga/index.tsx +++ b/web/app/components/base/ga/index.tsx @@ -3,7 +3,6 @@ import type { FC } from 'react' import { headers } from 'next/headers' import Script from 'next/script' import * as React from 'react' -import { IS_CE_EDITION } from '@/config' export enum GaType { admin = 'admin', @@ -29,8 +28,8 @@ const extractNonceFromCSP = (cspHeader: string | null): string | undefined => { const GA: FC = ({ gaType, }) => { - if (IS_CE_EDITION) - return null + // if (IS_CE_EDITION) + // return null const cspHeader = process.env.NODE_ENV === 'production' ? (headers() as unknown as UnsafeUnwrappedHeaders).get('content-security-policy')