From cd9f49b6b370ee1aa405b009c341fd46b3ab03f4 Mon Sep 17 00:00:00 2001
From: Bastien Dumont <bdumont@grandlyon.com>
Date: Wed, 27 Mar 2024 16:33:26 +0100
Subject: [PATCH] change footer btn

---
 src/components/Konnector/KonnectorModalFooter.tsx | 13 +++++++++++--
 src/components/Konnector/KonnectorViewerCard.tsx  |  3 ++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/components/Konnector/KonnectorModalFooter.tsx b/src/components/Konnector/KonnectorModalFooter.tsx
index f7466eea9..ba4a08df7 100644
--- a/src/components/Konnector/KonnectorModalFooter.tsx
+++ b/src/components/Konnector/KonnectorModalFooter.tsx
@@ -60,8 +60,7 @@ const KonnectorModalFooter = ({
         </Button>
       )
     case KonnectorError.LOGIN_FAILED:
-    case KonnectorError.CHALLENGE_ASKED:
-      // INCOMPLETE CONSENT FORM - GRDF
+      // INCOMPLETE CONSENT FORM - GRDF // what is this comment ?
       return (
         <Button
           aria-label={t('konnector_modal.accessibility.button_close')}
@@ -71,6 +70,16 @@ const KonnectorModalFooter = ({
           <div>{t('konnector_modal.button_try_again')}</div>
         </Button>
       )
+    case KonnectorError.CHALLENGE_ASKED:
+      return (
+        <Button
+          aria-label={t('konnector_modal.accessibility.button_close')}
+          onClick={() => handleCloseClick(state === SUCCESS_EVENT)}
+          className="btnPrimary"
+        >
+          <div>{t('konnector_modal.button_later')}</div>
+        </Button>
+      )
     case KonnectorError.TERMS_VERSION_MISMATCH:
       return (
         <div className="buttons">
diff --git a/src/components/Konnector/KonnectorViewerCard.tsx b/src/components/Konnector/KonnectorViewerCard.tsx
index 28a6f38d0..43b7e6e26 100644
--- a/src/components/Konnector/KonnectorViewerCard.tsx
+++ b/src/components/Konnector/KonnectorViewerCard.tsx
@@ -53,6 +53,7 @@ import {
   updateFluidConnection,
 } from 'store/global/global.slice'
 import { useAppDispatch, useAppSelector } from 'store/hooks'
+import logApp from 'utils/logger'
 import { getParamPicto } from 'utils/picto'
 import { getKonnectorSlug } from 'utils/utils'
 import ConnectionNotFound from './ConnectionNotFound/ConnectionNotFound'
@@ -173,7 +174,6 @@ const KonnectorViewerCard = ({
       const isGlobalLoginFailed =
         konnectorErrorDescription === KonnectorError.LOGIN_FAILED ||
         konnectorErrorDescription === KonnectorError.UNKNOWN_ERROR ||
-        konnectorErrorDescription === KonnectorError.CHALLENGE_ASKED ||
         konnectorErrorDescription === KonnectorError.CRITICAL ||
         konnectorErrorDescription === KonnectorError.MISSING_SECRET
 
@@ -189,6 +189,7 @@ const KonnectorViewerCard = ({
         (isGlobalLoginFailed || isEnedisCodeInseeError)
 
       if (shouldDeleteAccount) {
+        logApp('info', `shouldDeleteAccount`)
         // KEEP LAST LOGIN FOR EPGL
         if (
           fluidSlug === FluidSlugType.WATER &&
-- 
GitLab