Show error if attachment is rejected for having invalid mime type

pull/735/head
Stefano Pigozzi 2024-09-05 00:53:08 +02:00
rodzic 5d6a43e5d2
commit bf693ab979
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 5ADA3868646C3FC0
1 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -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);
}
}