Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix(studio): disable unified logs on self-hosted (#47727)

Jordi Enrice218b24f9658
diff --git a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx
index aa5065a4f98..ce32634141e 100644
--- a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx
+++ b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx
@@ -94,10 +94,11 @@ export const useUnifiedLogsPreview = () => {
const { flags, isInitialized, onUpdateFlag } = useFeaturePreviewContext()
const isLoading = !isInitialized
- const isEnabled = flags[LOCAL_STORAGE_KEYS.UI_PREVIEW_UNIFIED_LOGS]
+ const isEnabled = IS_PLATFORM && flags[LOCAL_STORAGE_KEYS.UI_PREVIEW_UNIFIED_LOGS]
const hasToggledPreview = !!safeLocalStorage.getItem(LOCAL_STORAGE_KEYS.UI_PREVIEW_UNIFIED_LOGS)
- const isDefaultOptIn = isInitialized && unifiedLogsDefaultOptIn && !hasToggledPreview
+ const isDefaultOptIn =
+ IS_PLATFORM && isInitialized && unifiedLogsDefaultOptIn && !hasToggledPreview
const enable = () => onUpdateFlag(LOCAL_STORAGE_KEYS.UI_PREVIEW_UNIFIED_LOGS, true)
const disable = () => onUpdateFlag(LOCAL_STORAGE_KEYS.UI_PREVIEW_UNIFIED_LOGS, false)
diff --git a/apps/studio/components/interfaces/UnifiedLogs/UnifiedLogsBanner.tsx b/apps/studio/components/interfaces/UnifiedLogs/UnifiedLogsBanner.tsx
index f42e66ef45f..43d1c936c5a 100644
--- a/apps/studio/components/interfaces/UnifiedLogs/UnifiedLogsBanner.tsx
+++ b/apps/studio/components/interfaces/UnifiedLogs/UnifiedLogsBanner.tsx
@@ -8,6 +8,7 @@ import {
useUnifiedLogsPreview,
} from '../App/FeaturePreview/FeaturePreviewContext'
import { ButtonTooltip } from '@/components/ui/ButtonTooltip'
+import { IS_PLATFORM } from '@/lib/constants'
interface UnifiedLogsBannerProps {
className?: string
@@ -20,6 +21,8 @@ export function UnifiedLogsBanner({ className = 'mx-4 mt-4' }: UnifiedLogsBanner
const { selectFeaturePreview } = useFeaturePreviewModal()
const { enable, disable, isDefaultOptIn, isEnabled } = useUnifiedLogsPreview()
+ if (!IS_PLATFORM) return null
+
const cardClassName = cn(
'rounded-lg border p-4 space-y-3 text-left',
'bg-muted/10 border-border/50',