refac: dragged overlay behaviour to only activate for files

This commit is contained in:
Timothy J. Baek
2024-10-14 21:03:55 -07:00
parent f8bb77324d
commit 93dab86e8d
4 changed files with 23 additions and 20 deletions

View File

@@ -184,7 +184,13 @@
const onDragOver = (e) => {
e.preventDefault();
dragged = true;
// Check if a file is being dragged.
if (e.dataTransfer?.types?.includes('Files')) {
dragged = true;
} else {
dragged = false;
}
};
const onDragLeave = () => {
@@ -200,8 +206,6 @@
if (inputFiles && inputFiles.length > 0) {
console.log(inputFiles);
inputFilesHandler(inputFiles);
} else {
toast.error($i18n.t(`File not found.`));
}
}