mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
refactor: update DocumentUploadTab to ensure unique file IDs are generated using a fallback method for compatibility
This commit is contained in:
parent
a65fda359a
commit
0a1d0035e6
1 changed files with 4 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue