(upload: CloudUpload)
| 286 | }; |
| 287 | |
| 288 | async function handleUploadFileFromDraft(upload: CloudUpload) { |
| 289 | const file = upload.item?.file; |
| 290 | if (!file) return; |
| 291 | |
| 292 | if (!isFileTypeAllowed(file)) { |
| 293 | showToast("File type not allowed by current filter", Toasts.Type.FAILURE); |
| 294 | return; |
| 295 | } |
| 296 | |
| 297 | if (!isConfigured()) { |
| 298 | showToast("Please configure BigFileUpload settings first", Toasts.Type.FAILURE); |
| 299 | return; |
| 300 | } |
| 301 | |
| 302 | try { |
| 303 | await uploadProvidedFiles([file], true); |
| 304 | upload.removeFromMsgDraft(); |
| 305 | } catch (e) { |
| 306 | logger.warn("Draft upload encountered an unexpected error", e); |
| 307 | } |
| 308 | } |
| 309 | |
| 310 | const ExternalIcon = () => <OpenExternalIcon height={24} width={24} />; |
| 311 |
no test coverage detected