mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-14 12:18:30 +03:00
Show error if attachment is rejected for having invalid mime type
This commit is contained in:
parent
5d6a43e5d2
commit
bf693ab979
1 changed files with 9 additions and 1 deletions
|
@ -584,7 +584,15 @@ function Compose({
|
|||
const item = items[i];
|
||||
if (item.kind === 'file') {
|
||||
const file = item.getAsFile();
|
||||
if (file && supportedMimeTypes.includes(file.type)) {
|
||||
if (!file) {
|
||||
alert(`Could not access the given attachment.`);
|
||||
return;
|
||||
}
|
||||
else if (!supportedMimeTypes.includes(file.type)) {
|
||||
alert(`Your instance does not allow attachments of type "${file.type}".`);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
files.push(file);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue