MCPcopy Create free account
hub / github.com/ScattrdBlade/bigFileUpload / handleUploadFileFromDraft

Function handleUploadFileFromDraft

index.tsx:288–308  ·  view source on GitHub ↗
(upload: CloudUpload)

Source from the content-addressed store, hash-verified

286};
287
288async 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
310const ExternalIcon = () => <OpenExternalIcon height={24} width={24} />;
311

Callers 1

channelAttachMenuPatchFunction · 0.85

Calls 3

isFileTypeAllowedFunction · 0.90
isConfiguredFunction · 0.90
uploadProvidedFilesFunction · 0.90

Tested by

no test coverage detected