mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-11 00:14:50 +03:00
Allow empty message body when there are attachments #1052
This commit is contained in:
parent
103b431780
commit
2adccdbaf3
1 changed files with 9 additions and 5 deletions
|
|
@ -1355,10 +1355,15 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
|
||||
async getMessageRequestParams(sSaveFolder, draft)
|
||||
{
|
||||
let Text = this.oEditor.getData().trim(),
|
||||
l = Text.length,
|
||||
hasAttachments = 0;
|
||||
|
||||
// Prepare ComposeAttachmentModel attachments
|
||||
const attachments = {};
|
||||
this.attachments.forEach(item => {
|
||||
if (item?.complete() && item?.tempName() && item?.enabled()) {
|
||||
++hasAttachments;
|
||||
attachments[item.tempName()] = {
|
||||
name: item.fileName(),
|
||||
inline: item.isInline,
|
||||
|
|
@ -1369,6 +1374,10 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
}
|
||||
});
|
||||
|
||||
if (!draft && !l && !hasAttachments) {
|
||||
throw i18n('COMPOSE/ERROR_EMPTY_BODY');
|
||||
}
|
||||
|
||||
const
|
||||
identity = this.currentIdentity(),
|
||||
params = {
|
||||
|
|
@ -1397,12 +1406,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
encrypt = this.pgpEncrypt() && this.canPgpEncrypt(),
|
||||
isHtml = this.oEditor.isHtml();
|
||||
|
||||
let Text = this.oEditor.getData().trim();
|
||||
if (!draft && !Text.length) {
|
||||
throw i18n('COMPOSE/ERROR_EMPTY_BODY');
|
||||
}
|
||||
if (isHtml) {
|
||||
let l;
|
||||
do {
|
||||
l = Text.length;
|
||||
Text = Text
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue