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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user