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

@@ -47,16 +47,10 @@ const getSkipMangasText = (settings: GlobalUpdateSkipEntriesSettings) => {
return skipSettings.join(', ');
};
const extractSkipEntriesSettings = (serverSettings: ServerSettings): GlobalUpdateSkipEntriesSettings => ({
excludeCompleted: serverSettings.excludeCompleted,
excludeNotStarted: serverSettings.excludeNotStarted,
excludeUnreadChapters: serverSettings.excludeUnreadChapters,
});
export const GlobalUpdateSettingsEntries = ({ serverSettings }: { serverSettings: ServerSettings }) => {
const { t } = useTranslation();
const globalUpdateSettings = extractSkipEntriesSettings(serverSettings);
const globalUpdateSettings = serverSettings;
const [mutateSettings] = requestManager.useUpdateServerSettings();
const [dialogSettings, setDialogSettings] = useState<GlobalUpdateSkipEntriesSettings>(