Feature/handle disabled download ahead limit by default (#475)

* Add a description to the dialog

* Set the default limit to the lowest possible value
This commit is contained in:
schroda
2023-11-25 17:15:07 +01:00
committed by GitHub
parent 6b2245d730
commit 2006ca9109
4 changed files with 41 additions and 7 deletions

View File

@@ -14,9 +14,9 @@ import { requestManager } from '@/lib/requests/RequestManager.ts';
import { NumberSetting } from '@/components/settings/NumberSetting.tsx';
import { getPersistedServerSetting, usePersistedValue } from '@/util/usePersistedValue.tsx';
const DEFAULT_LIMIT = 5;
const MIN_LIMIT = 2;
const MAX_LIMIT = 10;
const DEFAULT_LIMIT = MIN_LIMIT;
export const DownloadAheadSetting = () => {
const { t } = useTranslation();
@@ -75,6 +75,8 @@ export const DownloadAheadSetting = () => {
defaultValue={DEFAULT_LIMIT}
showSlider
dialogTitle={t('download.settings.download_ahead.label.unread_chapters_to_download')}
dialogDescription={t('download.settings.download_ahead.label.description')}
dialogDisclaimer={t('download.settings.download_ahead.label.disclaimer')}
valueUnit={t('chapter.title')}
handleUpdate={updateSetting}
disabled={!shouldDownloadAhead}