mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-27 04:45:08 +01:00
Composer: Fix duplicated documents when uploading in Firefox (#1705)
This commit is contained in:
parent
43704e92aa
commit
ed7e463001
@ -43,17 +43,15 @@ const DropArea: FC<OwnProps> = ({
|
|||||||
const { dataTransfer: dt } = e;
|
const { dataTransfer: dt } = e;
|
||||||
let files: File[] = [];
|
let files: File[] = [];
|
||||||
|
|
||||||
if (dt.items && dt.items.length > 0) {
|
if (dt.files && dt.files.length > 0 && (!dt.items || !dt.items.length)) {
|
||||||
|
files = files.concat(Array.from(dt.files));
|
||||||
|
} else if (dt.items && dt.items.length > 0) {
|
||||||
const folderFiles = await getFilesFromDataTransferItems(dt.items);
|
const folderFiles = await getFilesFromDataTransferItems(dt.items);
|
||||||
if (folderFiles.length) {
|
if (folderFiles.length) {
|
||||||
files = files.concat(folderFiles);
|
files = files.concat(folderFiles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dt.files && dt.files.length > 0) {
|
|
||||||
files = files.concat(Array.from(dt.files));
|
|
||||||
}
|
|
||||||
|
|
||||||
onHide();
|
onHide();
|
||||||
onFileSelect(files, false);
|
onFileSelect(files, false);
|
||||||
}, [onFileSelect, onHide]);
|
}, [onFileSelect, onHide]);
|
||||||
|
Loading…
Reference in New Issue
Block a user