diff --git a/client/src/apps/000/dashboard/config.tsx b/client/src/apps/000/dashboard/config.tsx index e2e0701de..729582d0f 100644 --- a/client/src/apps/000/dashboard/config.tsx +++ b/client/src/apps/000/dashboard/config.tsx @@ -6,6 +6,5 @@ export default { icon: 'tabler:dashboard', routes: { dashboard: lazy(() => import('.')) - }, - togglable: false + } } satisfies ModuleConfig diff --git a/client/src/apps/998.Settings/apiKeys/config.tsx b/client/src/apps/998.Settings/apiKeys/config.tsx index 70f905c08..68946d6cd 100644 --- a/client/src/apps/998.Settings/apiKeys/config.tsx +++ b/client/src/apps/998.Settings/apiKeys/config.tsx @@ -6,6 +6,5 @@ export default { icon: 'tabler:password', routes: { 'api-keys': lazy(() => import('.')) - }, - togglable: false + } } satisfies ModuleConfig diff --git a/client/src/apps/998.Settings/backups/config.tsx b/client/src/apps/998.Settings/backups/config.tsx index af4bd491c..89781e58c 100644 --- a/client/src/apps/998.Settings/backups/config.tsx +++ b/client/src/apps/998.Settings/backups/config.tsx @@ -6,6 +6,5 @@ export default { icon: 'tabler:history', routes: { backups: lazy(() => import('.')) - }, - togglable: false + } } satisfies ModuleConfig diff --git a/client/src/apps/998.Settings/personalization/config.tsx b/client/src/apps/998.Settings/personalization/config.tsx index 76af9c34e..81557c622 100644 --- a/client/src/apps/998.Settings/personalization/config.tsx +++ b/client/src/apps/998.Settings/personalization/config.tsx @@ -6,6 +6,5 @@ export default { icon: 'tabler:palette', routes: { personalization: lazy(() => import('.')) - }, - togglable: false + } } satisfies ModuleConfig diff --git a/client/src/routes/utils/moduleFilters.ts b/client/src/routes/utils/moduleFilters.ts deleted file mode 100644 index 69834d260..000000000 --- a/client/src/routes/utils/moduleFilters.ts +++ /dev/null @@ -1,37 +0,0 @@ -import _ from 'lodash' -import type { ModuleConfig } from 'shared' - -/** - * Determines if a module should be enabled based on user preferences and configuration - */ -export function shouldModuleBeEnabled( - item: ModuleConfig, - enabledModules: string[] -): boolean { - // If the module is force disabled, it should never be enabled - if (item.forceDisable) { - return false - } - - // If the module is not togglable, it's always enabled - if (!item.togglable) { - return true - } - - // For togglable modules, check if it's in the enabled modules list - const moduleKey = _.kebabCase(item.name) - - return enabledModules.includes(moduleKey) -} - -/** - * Filters modules based on visibility and enablement rules - */ -export function getEnabledModules( - items: ModuleConfig[], - enabledModules: string[] -): ModuleConfig[] { - return items.filter( - item => !item.hidden && shouldModuleBeEnabled(item, enabledModules) - ) -}