From 5cf5d02dfc08e373a5179b71d5be2a19c352cdfa Mon Sep 17 00:00:00 2001 From: Jordi Enric Date: Mon, 18 Aug 2025 15:36:45 +0200 Subject: [PATCH] fix --- .../App/FeaturePreview/FeaturePreviewContext.tsx | 5 ++--- .../layouts/LogsLayout/LogsSidebarMenuV2.tsx | 10 ++++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx index 3cf9aaec856..8a244a0205d 100644 --- a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx +++ b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx @@ -92,14 +92,13 @@ export const useIsInlineEditorEnabled = () => { } export const useUnifiedLogsPreview = () => { - const { data: organization } = useSelectedOrganizationQuery() const { flags, onUpdateFlag } = useFeaturePreviewContext() - const isTeamsOrEnterprise = ['team', 'enterprise'].includes(organization?.plan.id ?? '') - const isEnabled = isTeamsOrEnterprise && flags[LOCAL_STORAGE_KEYS.UI_PREVIEW_UNIFIED_LOGS] + const isEnabled = flags[LOCAL_STORAGE_KEYS.UI_PREVIEW_UNIFIED_LOGS] const enable = () => onUpdateFlag(LOCAL_STORAGE_KEYS.UI_PREVIEW_UNIFIED_LOGS, true) const disable = () => onUpdateFlag(LOCAL_STORAGE_KEYS.UI_PREVIEW_UNIFIED_LOGS, false) + return { isEnabled, enable, disable } } diff --git a/apps/studio/components/layouts/LogsLayout/LogsSidebarMenuV2.tsx b/apps/studio/components/layouts/LogsLayout/LogsSidebarMenuV2.tsx index 3966b31be97..35a7b60cede 100644 --- a/apps/studio/components/layouts/LogsLayout/LogsSidebarMenuV2.tsx +++ b/apps/studio/components/layouts/LogsLayout/LogsSidebarMenuV2.tsx @@ -112,10 +112,8 @@ export function LogsSidebarMenuV2() { // [Jordi] We only want to show ETL logs if the user has the feature enabled AND they're using the feature aka they've created a source. const showETLLogs = enablePgReplicate && (etlData?.sources?.length ?? 0) > 0 && !isETLLoading - const { plan: orgPlan, isLoading: isOrgPlanLoading } = useCurrentOrgPlan() - const isFreePlan = !isOrgPlanLoading && orgPlan?.id === 'free' - - const isUnifiedLogsPreviewAvailable = unifiedLogsFlagEnabled && !isOrgPlanLoading + const { plan: orgPlan } = useCurrentOrgPlan() + const isFreePlan = orgPlan?.id === 'free' const { data: savedQueriesRes, isLoading: savedQueriesLoading } = useContentQuery({ projectRef: ref, @@ -231,7 +229,7 @@ export function LogsSidebarMenuV2() { return (
- {IS_PLATFORM && !isUnifiedLogsPreviewAvailable && ( + {IS_PLATFORM && !unifiedLogsFlagEnabled && ( Coming soon} @@ -246,7 +244,7 @@ export function LogsSidebarMenuV2() { } /> )} - {isUnifiedLogsPreviewAvailable && ( + {unifiedLogsFlagEnabled && (