Add missing error message on settings change error

This commit is contained in:
schroda
2024-09-26 12:51:46 +02:00
parent 314ad39ee0
commit c72cf9a0ab
5 changed files with 18 additions and 6 deletions

View File

@@ -39,7 +39,7 @@ export const DownloadAheadSetting = ({
const updateSetting = (value: MetadataDownloadSettings['downloadAheadLimit']) => {
persistDownloadAheadLimit(value === 0 ? currentDownloadAheadLimit : value);
updateMetadataServerSettings('downloadAheadLimit', value).catch(() =>
makeToast(t('search.error.label.failed_to_save_settings'), 'warning'),
makeToast(t('global.error.label.failed_to_save_changes'), 'error'),
);
};

View File

@@ -16,6 +16,7 @@ import { requestManager } from '@/lib/requests/RequestManager.ts';
import { NumberSetting } from '@/components/settings/NumberSetting.tsx';
import { getPersistedServerSetting, usePersistedValue } from '@/util/usePersistedValue.tsx';
import { ServerSettings } from '@/typings.ts';
import { makeToast } from '@/components/util/Toast.tsx';
const DEFAULT_VALUE = 23;
const MIN_VALUE = 1;
@@ -44,7 +45,9 @@ export const WebUIUpdateIntervalSetting = ({
persistUpdateCheckInterval(
webUIUpdateCheckInterval === 0 ? currentUpdateCheckInterval : webUIUpdateCheckInterval,
);
mutateSettings({ variables: { input: { settings: { webUIUpdateCheckInterval } } } });
mutateSettings({ variables: { input: { settings: { webUIUpdateCheckInterval } } } }).catch(() =>
makeToast(t('global.error.label.failed_to_save_changes'), 'error'),
);
},
[currentUpdateCheckInterval],
);