From 7e7eec7845f90bedd55c860c0011a456c459e59a Mon Sep 17 00:00:00 2001
From: Damien <damien.burel@maarch.org>
Date: Mon, 17 Feb 2020 18:26:06 +0100
Subject: [PATCH] FEAT #12072 TIME 0:15 Fix empty object email summary

---
 .../app/mail/mail-resume/mail-resume.component.ts         | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/frontend/app/mail/mail-resume/mail-resume.component.ts b/src/frontend/app/mail/mail-resume/mail-resume.component.ts
index ac48549fcc9..cf8f35f18fd 100644
--- a/src/frontend/app/mail/mail-resume/mail-resume.component.ts
+++ b/src/frontend/app/mail/mail-resume/mail-resume.component.ts
@@ -4,6 +4,7 @@ import { LANG } from '../../translate.component';
 import { catchError, tap, finalize, map } from 'rxjs/operators';
 import { of } from 'rxjs';
 import { NotificationService } from '../../notification.service';
+import {FunctionsService} from "../../../service/functions.service";
 
 
 @Component({
@@ -28,6 +29,7 @@ export class MailResumeComponent implements OnInit {
     constructor(
         public http: HttpClient,
         private notify: NotificationService,
+        public functions: FunctionsService
     ) {
     }
 
@@ -43,10 +45,10 @@ export class MailResumeComponent implements OnInit {
                 data.elementsSend = data.elementsSend.map((elem: any) => {
                     let object = elem.object;
                     let type = elem.type;
-                    if (elem.object === '') {
+                    if (elem.type == 'aknowledgement_receipt' && this.functions.empty(elem.object)) {
                         object = this.lang.ARPaper;
                         type = 'aknowledgement_receipt';
-                    } else if (elem.object.startsWith("[AR]")) {
+                    } else if (elem.type == 'aknowledgement_receipt' && elem.object.startsWith("[AR]")) {
                         object = this.lang.ARelectronic;
                         type = 'aknowledgement_receipt';
                     }
@@ -75,4 +77,4 @@ export class MailResumeComponent implements OnInit {
     showMore() {
         this.goTo.emit();
     }
-}
\ No newline at end of file
+}
-- 
GitLab