Merge branch 'Molunerfinn:dev' into dev

This commit is contained in:
萌萌哒赫萝 2023-01-16 23:11:36 +08:00 committed by GitHub
commit b9a75d853a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 22 deletions

View File

@ -84,7 +84,13 @@ watch(progress, (val) => {
function onDrop (e: DragEvent) {
dragover.value = false
const items = e.dataTransfer!.items
const items = e.dataTransfer?.items!
const files = e.dataTransfer?.files!
// send files first
if (files?.length) {
ipcSendFiles(e.dataTransfer?.files!)
} else {
if (items.length === 2 && items[0].type === 'text/uri-list') {
handleURLDrag(items, e.dataTransfer!)
} else if (items[0].type === 'text/plain') {
@ -94,8 +100,7 @@ function onDrop (e: DragEvent) {
} else {
$message.error($T('TIPS_DRAG_VALID_PICTURE_OR_URL'))
}
} else {
ipcSendFiles(e.dataTransfer!.files)
}
}
}

View File

@ -169,7 +169,13 @@ onBeforeUnmount(() => {
function onDrop (e: DragEvent) {
dragover.value = false
const items = e.dataTransfer!.items
const items = e.dataTransfer?.items!
const files = e.dataTransfer?.files!
// send files first
if (files?.length) {
ipcSendFiles(e.dataTransfer?.files!)
} else {
if (items.length === 2 && items[0].type === 'text/uri-list') {
handleURLDrag(items, e.dataTransfer!)
} else if (items[0].type === 'text/plain') {
@ -179,8 +185,7 @@ function onDrop (e: DragEvent) {
} else {
$message.error($T('TIPS_DRAG_VALID_PICTURE_OR_URL'))
}
} else {
ipcSendFiles(e.dataTransfer!.files)
}
}
}