From f4066e6e5a79e9aff4105a8870c0d9eb8ea78830 Mon Sep 17 00:00:00 2001 From: Dinh Long Nguyen Date: Thu, 9 Oct 2025 04:50:31 +0700 Subject: [PATCH] Update web-app/src/lib/fileMetadata.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- web-app/src/lib/fileMetadata.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/web-app/src/lib/fileMetadata.ts b/web-app/src/lib/fileMetadata.ts index 21067c56e..ce5eb3de4 100644 --- a/web-app/src/lib/fileMetadata.ts +++ b/web-app/src/lib/fileMetadata.ts @@ -84,7 +84,17 @@ export function extractFilesFromPrompt(prompt: string): { const type = map['type'] const size = map['size'] ? Number(map['size']) : undefined const chunkCount = map['chunks'] ? Number(map['chunks']) : undefined - files.push({ id, name, ...(type && { type }), ...(typeof size === 'number' && !Number.isNaN(size) ? { size } : {}), ...(typeof chunkCount === 'number' && !Number.isNaN(chunkCount) ? { chunkCount } : {}) }) + const fileObj: FileMetadata = { id, name }; + if (type) { + fileObj.type = type; + } + if (typeof size === 'number' && !Number.isNaN(size)) { + fileObj.size = size; + } + if (typeof chunkCount === 'number' && !Number.isNaN(chunkCount)) { + fileObj.chunkCount = chunkCount; + } + files.push(fileObj); } // Extract clean prompt (everything before [ATTACHED_FILES])