mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 08:12:00 +02:00
🖼️ fix: Clipboard Files & File Name Issues (#2015)
* fix: ensure image handling fetchs image to base64 for multiple images * fix: append file_id's when writing uploaded files * feat: timestamp files uploaded from clipboard * chore: add a different fileid+name separator
This commit is contained in:
parent
18edd2660b
commit
40e884b3ec
5 changed files with 31 additions and 18 deletions
|
@ -179,7 +179,14 @@ export default function useTextarea({
|
|||
if (e.clipboardData && e.clipboardData.files.length > 0) {
|
||||
e.preventDefault();
|
||||
setFilesLoading(true);
|
||||
handleFiles(e.clipboardData.files);
|
||||
const timestampedFiles: File[] = [];
|
||||
for (const file of e.clipboardData.files) {
|
||||
const newFile = new File([file], `clipboard_${+new Date()}_${file.name}`, {
|
||||
type: file.type,
|
||||
});
|
||||
timestampedFiles.push(newFile);
|
||||
}
|
||||
handleFiles(timestampedFiles);
|
||||
}
|
||||
},
|
||||
[handleFiles, setFilesLoading, setText],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue