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:
@@ -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 }}>
|
||||
|
||||
Reference in New Issue
Block a user