mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-31 02:51:36 +02: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 handleItems = (e) => {
|
||||||
const { items } = e.clipboardData || e.dataTransfer;
|
const { items } = e.clipboardData || e.dataTransfer;
|
||||||
const files = [];
|
const files = [];
|
||||||
const unattachableFiles = [];
|
|
||||||
const unsupportedFiles = [];
|
const unsupportedFiles = [];
|
||||||
for (let i = 0; i < items.length; i++) {
|
for (let i = 0; i < items.length; i++) {
|
||||||
const item = items[i];
|
const item = items[i];
|
||||||
if (item.kind === 'file') {
|
if (item.kind === 'file') {
|
||||||
const file = item.getAsFile();
|
const file = item.getAsFile();
|
||||||
if (!file) {
|
if (supportedMimeTypes !== undefined && !supportedMimeTypes.includes(file.type)) {
|
||||||
unattachableFiles.push(file);
|
|
||||||
}
|
|
||||||
else if (supportedMimeTypes !== undefined && !supportedMimeTypes.includes(file.type)) {
|
|
||||||
unsupportedFiles.push(file);
|
unsupportedFiles.push(file);
|
||||||
}
|
}
|
||||||
else {
|
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) {
|
if (unsupportedFiles.length > 0) {
|
||||||
alert(
|
alert(
|
||||||
plural(unsupportedFiles.length, {
|
plural(unsupportedFiles.length, {
|
||||||
|
|
Loading…
Add table
Reference in a new issue