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:
@@ -42,13 +42,6 @@ import { BrowseTab } from '@/features/browse/Browse.types.ts';
|
||||
|
||||
type BackupSettingsType = Pick<ServerSettings, 'backupPath' | 'backupTime' | 'backupInterval' | 'backupTTL'>;
|
||||
|
||||
const extractBackupSettings = (settings: ServerSettings): BackupSettingsType => ({
|
||||
backupPath: settings.backupPath,
|
||||
backupTime: settings.backupTime,
|
||||
backupInterval: settings.backupInterval,
|
||||
backupTTL: settings.backupTTL,
|
||||
});
|
||||
|
||||
const getBackupCleanupDisplayValue = (ttl: number): string => {
|
||||
if (ttl === 0) {
|
||||
return translate('global.label.never');
|
||||
@@ -224,7 +217,7 @@ export function Backup() {
|
||||
);
|
||||
}
|
||||
|
||||
const backupSettings = extractBackupSettings(settingsData!.settings);
|
||||
const backupSettings = settingsData!.settings;
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user