Remove redundant extract helper functions for server settings

Simplifies settings usage by directly accessing the `settings` object instead of relying on intermediary extraction functions. Improves code readability and reduces unnecessary abstraction.

Ensures consistency across all settings components for a cleaner and more efficient implementation.
This commit is contained in:
schroda
2025-09-08 00:46:57 +02:00
parent 47e93c774f
commit 94299433c8
7 changed files with 8 additions and 139 deletions

View File

@@ -30,12 +30,6 @@ import { useAppTitle } from '@/features/navigation-bar/hooks/useAppTitle.ts';
type ExtensionsSettings = Pick<GqlServerSettings, 'maxSourcesInParallel' | 'localSourcePath' | 'extensionRepos'>;
const extractBrowseSettings = (settings: GqlServerSettings): ExtensionsSettings => ({
maxSourcesInParallel: settings.maxSourcesInParallel,
localSourcePath: settings.localSourcePath,
extensionRepos: settings.extensionRepos,
});
export const BrowseSettings = () => {
const { t } = useTranslation();
@@ -76,7 +70,7 @@ export const BrowseSettings = () => {
);
}
const serverSettings = extractBrowseSettings(data!.settings);
const serverSettings = data!.settings;
return (
<List sx={{ pt: 0 }}>