From 0a1d0035e6842caed422e48283bff24e05cfb1ab Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Sun, 8 Mar 2026 21:11:54 +0530 Subject: [PATCH] refactor: update DocumentUploadTab to ensure unique file IDs are generated using a fallback method for compatibility --- surfsense_web/components/sources/DocumentUploadTab.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/surfsense_web/components/sources/DocumentUploadTab.tsx b/surfsense_web/components/sources/DocumentUploadTab.tsx index f1c81bbfb..30db47801 100644 --- a/surfsense_web/components/sources/DocumentUploadTab.tsx +++ b/surfsense_web/components/sources/DocumentUploadTab.tsx @@ -148,7 +148,10 @@ export function DocumentUploadTab({ const onDrop = useCallback( (acceptedFiles: File[]) => { setFiles((prev) => { - const newEntries = acceptedFiles.map((f) => ({ id: crypto.randomUUID(), file: f })); + const newEntries = acceptedFiles.map((f) => ({ + id: crypto.randomUUID?.() ?? `file-${Date.now()}-${Math.random().toString(36)}`, + file: f, + })); const newFiles = [...prev, ...newEntries]; if (newFiles.length > MAX_FILES) {