From 0ef4de3543a95a68d55d036cdde99a321985fce1 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Sat, 28 Jun 2025 03:09:44 +0200 Subject: [PATCH] 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 56f01efc1e063303e4ed6399e691995d536af890 --- src/modules/metadata/Metadata.constants.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/metadata/Metadata.constants.ts b/src/modules/metadata/Metadata.constants.ts index 20ec0e13..363055d9 100644 --- a/src/modules/metadata/Metadata.constants.ts +++ b/src/modules/metadata/Metadata.constants.ts @@ -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,