fix(ui): clarify download properties inputs

This commit is contained in:
NimBold
2026-08-06 23:58:06 +03:30
parent c9046f8273
commit e2654510af
12 changed files with 679 additions and 51 deletions
@@ -25,9 +25,11 @@ import {
beginExclusivePropertiesAction,
classifyPropertiesActionRequest,
createFrameCoalescer,
decodePropertiesPatchValue,
enqueuePropertiesAction,
getPropertiesLifecycleAction,
propertiesActionRequestKey,
PROPERTIES_PATCH_CLEARABLE_KEYS,
sanitizePropertiesSnapshot,
sendPropertiesActionResult,
sendPropertiesRemoved,
@@ -86,6 +88,13 @@ const copyEditablePatch = (rawPatch: PropertiesPatch): Partial<DownloadItem> =>
'torrentFileAllocation',
] as const) copy(key);
for (const key of PROPERTIES_PATCH_CLEARABLE_KEYS) {
if (Object.prototype.hasOwnProperty.call(rawPatch, key)) {
const value = (rawPatch as Record<string, unknown>)[key];
(safePatch as Record<string, unknown>)[key] = decodePropertiesPatchValue(value);
}
}
if (safePatch.fileName !== undefined && typeof safePatch.fileName !== 'string') {
throw new Error('Invalid file name');
}