feat: support audio file uploads via clipboard in post editor (#743)
This commit is contained in:
parent
942c9a7d12
commit
3196c43644
1 changed files with 2 additions and 2 deletions
|
|
@ -60,7 +60,7 @@ export const ClipboardAndDropHandler = Extension.create<ClipboardAndDropHandlerO
|
|||
|
||||
const items = Array.from(event.dataTransfer?.files ?? [])
|
||||
const mediaFiles = items.filter(
|
||||
(item) => item.type.includes('image') || item.type.includes('video')
|
||||
(item) => item.type.includes('image') || item.type.includes('video') || item.type.includes('audio')
|
||||
)
|
||||
if (!mediaFiles.length) return false
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ export const ClipboardAndDropHandler = Extension.create<ClipboardAndDropHandlerO
|
|||
for (const item of items) {
|
||||
if (
|
||||
item.kind === 'file' &&
|
||||
(item.type.includes('image') || item.type.includes('video'))
|
||||
(item.type.includes('image') || item.type.includes('video') || item.type.includes('audio'))
|
||||
) {
|
||||
const file = item.getAsFile()
|
||||
if (file) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue