Skip to content

Commit 848c876

Browse files
authored
fix(chat): hide the Sim links settings section where Sim links are off (#9615)
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.
1 parent e137d82 commit 848c876

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎apps/sim/lib/mothership/tools/server/settings.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ import {
6464
} from '@/lib/organizations/application/settings'
6565
import { authorizeOrganizationSettingsSection } from '@/lib/settings/application/organization-section-access'
6666
import { type SettingsSection, settingsSections } from '@/lib/settings/sections'
67+
import { isSimLinksEnabled } from '@/lib/sim-links/feature-flag'
6768
import {
6869
delegatedAccountPreferencesSchema,
6970
updateCurrentUserPreferences,
@@ -314,6 +315,12 @@ const adapters: Record<string, SettingAdapter> = {
314315
}
315316

316317
async function describeSection(context: SettingsContext, section: SettingsSection) {
318+
if (
319+
context.scope === 'organization' &&
320+
section.id === 'sim-links' &&
321+
!(await isSimLinksEnabled(organizationInput(context).organizationId))
322+
)
323+
return null
317324
const adapter = adapters[`${context.scope}/${section.id}`]
318325
const uiSection =
319326
context.scope === 'organization' &&

0 commit comments

Comments
 (0)