refactor: update DocumentUploadTab to ensure unique file IDs are generated using a fallback method for compatibility

This commit is contained in:
Anish Sarkar 2026-03-08 21:11:54 +05:30
parent a65fda359a
commit 0a1d0035e6

View file

@ -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) {