Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

Refactor createFileMetadata to streamline metadata object construction

Salman-Ahamedd848b7c6a184
diff --git a/packages/app/src/react/features/ai-chat/utils/file.ts b/packages/app/src/react/features/ai-chat/utils/file.ts
index a001cca9..077fd297 100644
--- a/packages/app/src/react/features/ai-chat/utils/file.ts
+++ b/packages/app/src/react/features/ai-chat/utils/file.ts
@@ -145,9 +145,5 @@ export const deleteFile = async (key: string): Promise<boolean> => {
export const createFileMetadata = (file: File): FileWithMetadata => ({
file,
id: `${file.name}-${file.size}-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
- metadata: {
- fileType: file.type,
- previewUrl: getLocalPreviewUrl(file),
- isUploading: true,
- },
+ metadata: { fileType: file.type, previewUrl: getLocalPreviewUrl(file), isUploading: true },
});