diff --git a/src/components/Konnector/KonnectorModal.tsx b/src/components/Konnector/KonnectorModal.tsx index c03c05a0b7ab2e09db97db9756b03cedcd68b4f0..5a16d77dacd514d8f523ed62f8f31082e32d05b4 100644 --- a/src/components/Konnector/KonnectorModal.tsx +++ b/src/components/Konnector/KonnectorModal.tsx @@ -4,7 +4,6 @@ import EnedisIcon from 'assets/icons/ico/consent-outdated-enedis.svg' import errorIcon from 'assets/icons/visu/data-nok.svg' import successIcon from 'assets/icons/visu/data-ok.svg' import classNames from 'classnames' -import { GrdfWaitConsent } from 'components/Connection/GRDFConnect/GrdfWaitConsent' import Loader from 'components/Loader/Loader' import connectionWaitingText from 'constants/connectionWaitingText.json' import firstConnectionWaitingText from 'constants/firstConnectionWaitingText.json' @@ -264,15 +263,9 @@ const KonnectorModal = ({ </div> </div> )} - {/* Wait consent alert */} - {error === KonnectorError.CHALLENGE_ASKED && - fluidType === FluidType.GAS && ( - <GrdfWaitConsent showRelaunch={false} /> - )} {error !== KonnectorError.LOGIN_FAILED && error !== KonnectorError.TERMS_VERSION_MISMATCH && - error !== KonnectorError.CHALLENGE_ASKED && error !== KonnectorError.USER_ACTION_NEEDED_ACCOUNT_REMOVED && ( // DEFAULT CASE diff --git a/src/components/Konnector/KonnectorViewerCard.tsx b/src/components/Konnector/KonnectorViewerCard.tsx index 4b202499a778641e3ad7646a2c0199c749f6474d..828f8bcffe5dad24fd67ddb829253ca26c9b5873 100644 --- a/src/components/Konnector/KonnectorViewerCard.tsx +++ b/src/components/Konnector/KonnectorViewerCard.tsx @@ -298,13 +298,20 @@ const KonnectorViewerCard = ({ await refreshChallengeState(), await updateGlobalFluidStatus(), ]) + setKonnectorState(_state) + /** If waiting for consent, close Konnector modal */ + if (isWaitingForConsent) { + setOpenModal(false) + setKonnectorState(null) + } } }, [ - dispatch, currentFluidStatus.connection, currentFluidStatus.fluidType, + dispatch, + isWaitingForConsent, refreshChallengeState, updateGlobalFluidStatus, ]