From 9c29863079aabe6a22b11c3b7c22e5820bb06dd0 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 26 Jul 2022 13:22:54 +0200 Subject: [PATCH] Fix from/to addresses in mail preview getting duplicated --- mail/js/app.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mail/js/app.js b/mail/js/app.js index 949db59a39..190bb767d8 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -1060,7 +1060,13 @@ app.classes.mail = AppJS.extend( if (data.toaddress||data.fromaddress) { 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.filter((i, item) => { + return data.additionalfromaddress.indexOf(i) == item + }); } if (data.attachmentsBlock) data.attachmentsBlockTitle = `${data.attachmentsBlock.length} attachments`;