(e)
| 360 | return acceptedAttachmentTypes && types.has(acceptedAttachmentTypes) ? 'copy' : 'cancel'; |
| 361 | }, |
| 362 | async onDrop(e) { |
| 363 | let files = await Promise.all( |
| 364 | e.items |
| 365 | .filter(isFileDropItem) |
| 366 | .filter(item => matchMimeType(item.type, acceptedAttachmentTypes!)) |
| 367 | .map(async item => ({ |
| 368 | id: crypto.randomUUID(), |
| 369 | file: await item.getFile(), |
| 370 | image: item.type.startsWith('image/') ? URL.createObjectURL(await item.getFile()) : '' |
| 371 | })) |
| 372 | ); |
| 373 | onAddAttachments?.(files); |
| 374 | setAttachments(attachments => [...attachments, ...files]); |
| 375 | } |
| 376 | }); |
| 377 | |
| 378 | let [isListening, setListening] = useState(false); |
nothing calls this directly
no test coverage detected