From ae3f8587e54d23006bfa9633fa238c46456e97d0 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Mon, 2 Nov 2026 22:11:34 -0800 Subject: [PATCH] fix(chat): hide the Sim links settings section where Sim links are off Chat's settings list advertised the Sim links section to every organization. Its operations already refused when the rollout flag was off, but Chat would still offer it. describeSection now drops it for those organizations, so list omits it and open/get/describe/execute refuse it up front. --- apps/sim/lib/mothership/tools/server/settings.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/sim/lib/mothership/tools/server/settings.ts b/apps/sim/lib/mothership/tools/server/settings.ts index 6ec644d6ebe..137b4ea133e 100644 --- a/apps/sim/lib/mothership/tools/server/settings.ts +++ b/apps/sim/lib/mothership/tools/server/settings.ts @@ -64,6 +64,7 @@ import { } from '@/lib/organizations/application/settings' import { authorizeOrganizationSettingsSection } from '@/lib/settings/application/organization-section-access' import { type SettingsSection, settingsSections } from '@/lib/settings/sections' +import { isSimLinksEnabled } from '@/lib/sim-links/feature-flag' import { delegatedAccountPreferencesSchema, updateCurrentUserPreferences, @@ -314,6 +315,12 @@ const adapters: Record = { } async function describeSection(context: SettingsContext, section: SettingsSection) { + if ( + context.scope === 'organization' && + section.id === 'sim-links' && + !(await isSimLinksEnabled(organizationInput(context).organizationId)) + ) + return null const adapter = adapters[`${context.scope}/${section.id}`] const uiSection = context.scope === 'organization' &&