Fix disabled "download ahead" setting visualization

The setting is disabled in case the value is 0.
Due to "toConstrainedValue" this was not possible anymore which lead to the disabled setting to still be shown as enabled.

Regression 56f01efc1e
This commit is contained in:
schroda
2025-06-28 03:09:44 +02:00
parent 7702edb02f
commit 0ef4de3543

View File

@@ -78,7 +78,14 @@ export const APP_METADATA: Record<
},
downloadAheadLimit: {
convert: convertToNumber,
toConstrainedValue: (value: number) => coerceIn(value, DOWNLOAD_AHEAD.min, DOWNLOAD_AHEAD.max),
toConstrainedValue: (value: number) => {
const isDisabled = value === 0;
if (isDisabled) {
return value;
}
return coerceIn(value, DOWNLOAD_AHEAD.min, DOWNLOAD_AHEAD.max);
},
},
showAddToLibraryCategorySelectDialog: {
convert: convertToBoolean,