Added multiple simultaneous map and token upload support

This commit is contained in:
Mitchell McCaffrey
2020-05-31 10:53:33 +10:00
parent 31cdbbb8dd
commit 55bf9e4d03
3 changed files with 51 additions and 26 deletions

View File

@@ -18,10 +18,14 @@ function ImageDrop({ onDrop, dropText, children }) {
function handleImageDrop(event) {
event.preventDefault();
event.stopPropagation();
const file = event.dataTransfer.files[0];
if (file && file.type.startsWith("image")) {
onDrop(file);
const files = event.dataTransfer.files;
let imageFiles = [];
for (let file of files) {
if (file.type.startsWith("image")) {
imageFiles.push(file);
}
}
onDrop(imageFiles);
setDragging(false);
}