Commit 6daecd5b authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #18927 TIME 1:18 set attachment values if email not send

parent 5fdd9783
......@@ -310,6 +310,23 @@ export class MailEditorComponent implements OnInit, OnDestroy {
}
});
if (this.emailStatus !== 'SENT') {
await this.getAttachElements(false);
const attachIds: number[] = this.emailAttachTool.attachments.list.map((item: any) => item.id);
this.emailAttach.attachments.forEach((element: any, index: number) => {
if (attachIds.indexOf(element.id) > -1) {
const attachment: any = this.emailAttachTool.attachments.list.find((item: any) => item.id === element.id);
this.emailAttach.attachments[index] = {
id: attachment.id,
format: attachment.format,
label: attachment.label,
original: attachment.original,
size: attachment.size
}
}
});
}
resolve(true);
}),
catchError((err) => {
......@@ -965,7 +982,7 @@ export class MailEditorComponent implements OnInit, OnDestroy {
objAttach[element] = this.emailAttach[element].map((item: any) => item.id);
} else {
objAttach[element] = this.emailAttach[element].map((item: any) => ({
id: element === 'attachments' && this.signedAttachId !== null ? this.signedAttachId : item.id,
id: element === 'attachments' && this.emailStatus === 'SENT' && this.signedAttachId !== null ? this.signedAttachId : item.id,
original: item.original
}));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment