From ff89fe5af39fa900fd06f6551d4b8e40869641d5 Mon Sep 17 00:00:00 2001
From: Matthieu Benoist <mbenoist@ausy-group.com>
Date: Wed, 13 Jan 2021 16:35:51 +0100
Subject: [PATCH] Corrects the feedbackform bad syntax

---
 .../core/components/feedback/feedback.component.ts   | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/app/core/components/feedback/feedback.component.ts b/src/app/core/components/feedback/feedback.component.ts
index 89abd60d..49ad24e5 100644
--- a/src/app/core/components/feedback/feedback.component.ts
+++ b/src/app/core/components/feedback/feedback.component.ts
@@ -61,7 +61,10 @@ export class FeedbackComponent implements OnInit {
 
     this.feedbackForm.get('email').valueChanges.subscribe(
       (emailValue) => {
-        emailValue === '' || emailValue === null ? consent.setValue(false) : null;
+        if (emailValue === '' || emailValue === null ) {
+          consent.setValue(false);
+        }
+
         if (emailValue !== null && emailValue !== '') {
           consent.setValidators([Validators.requiredTrue]);
         } else {
@@ -115,7 +118,12 @@ export class FeedbackComponent implements OnInit {
   }
 
   get feedbackHasEmail() {
-    return this.feedbackForm.get('email').value && this.feedbackForm.get('email').value;
+    if (this.feedbackForm.get('email').value !== null && this.feedbackForm.get('email').value !== '') {
+      return true;
+    }
+    else {
+      return false;
+    }
   }
 
   get shouldAnimateClosing() {
-- 
GitLab