Fix from/to addresses in mail preview getting duplicated

This commit is contained in:
Hadi Nategh 2022-07-26 13:22:54 +02:00
parent e9c4694d09
commit 9c29863079

View File

@ -1060,7 +1060,13 @@ app.classes.mail = AppJS.extend(
if (data.toaddress||data.fromaddress) if (data.toaddress||data.fromaddress)
{ {
data.additionaltoaddress = (data.additionaltoaddress??[]).concat(data.toaddress); data.additionaltoaddress = (data.additionaltoaddress??[]).concat(data.toaddress);
data.additionaltoaddress = data.additionaltoaddress.filter((i, item) => {
return data.additionaltoaddress.indexOf(i) == item
});
data.additionalfromaddress = (data.additionalfromaddress??[]).concat(data.fromaddress); data.additionalfromaddress = (data.additionalfromaddress??[]).concat(data.fromaddress);
data.additionalfromaddress = data.additionalfromaddress.filter((i, item) => {
return data.additionalfromaddress.indexOf(i) == item
});
} }
if (data.attachmentsBlock) data.attachmentsBlockTitle = `${data.attachmentsBlock.length} attachments`; if (data.attachmentsBlock) data.attachmentsBlockTitle = `${data.attachmentsBlock.length} attachments`;