From 1abbe33b765342bf93b072ba677aeb44d1d5dd7f Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 10 Sep 2024 16:46:16 +0200 Subject: [PATCH] Remove `unattachableFiles` --- src/components/compose.jsx | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/components/compose.jsx b/src/components/compose.jsx index 513cb257..93f56058 100644 --- a/src/components/compose.jsx +++ b/src/components/compose.jsx @@ -602,16 +602,12 @@ function Compose({ const handleItems = (e) => { const { items } = e.clipboardData || e.dataTransfer; const files = []; - const unattachableFiles = []; const unsupportedFiles = []; for (let i = 0; i < items.length; i++) { const item = items[i]; if (item.kind === 'file') { const file = item.getAsFile(); - if (!file) { - unattachableFiles.push(file); - } - else if (supportedMimeTypes !== undefined && !supportedMimeTypes.includes(file.type)) { + if (supportedMimeTypes !== undefined && !supportedMimeTypes.includes(file.type)) { unsupportedFiles.push(file); } else { @@ -619,15 +615,6 @@ function Compose({ } } } - console.error(unattachableFiles, unsupportedFiles) - if (unattachableFiles.length > 0) { - alert( - plural(unattachableFiles.length, { - one: `Couldn't attach file ${unattachableFiles[0].name}.`, - other: `Couldn't attach files ${lf.format(unattachableFiles.map(f => f.name))}.`, - }), - ); - } if (unsupportedFiles.length > 0) { alert( plural(unsupportedFiles.length, {