mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-03 15:00:50 +03:00
Remove unattachableFiles
This commit is contained in:
parent
774605d1ee
commit
1abbe33b76
1 changed files with 1 additions and 14 deletions
|
@ -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, {
|
||||
|
|
Loading…
Add table
Reference in a new issue