mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-23 09:19:06 +00:00
fix(ui): clarify download properties inputs
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user