Merge pull request #2593 from omnivore-app/fix/web-dnd-detection

Dont open the upload modal unless a file is being dragged
This commit is contained in:
Jackson Harper 2023-08-04 13:27:35 +08:00 committed by GitHub
commit f79340115e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -952,7 +952,11 @@ function LibraryItemsLayout(props: LibraryItemsLayoutProps): JSX.Element {
{props.isValidating && props.items.length == 0 && <TopBarProgress />}
<div
onDragEnter={(event) => {
setShowUploadModal(true)
if (
event.dataTransfer.types.find((t) => t.toLowerCase() == 'files')
) {
setShowUploadModal(true)
}
}}
style={{ height: '100%', width: '100%' }}
>