From 05215ca8e20541f70fa2741b56dac629f66f3b5e Mon Sep 17 00:00:00 2001 From: Alice Dahan Date: Tue, 4 Feb 2025 14:14:07 +0100 Subject: [PATCH] fix(AE): affichage du message d'alerte type d'entreprise --- site/source/components/WrongSimulateurWarning.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/site/source/components/WrongSimulateurWarning.tsx b/site/source/components/WrongSimulateurWarning.tsx index 95e857d67..073229d32 100644 --- a/site/source/components/WrongSimulateurWarning.tsx +++ b/site/source/components/WrongSimulateurWarning.tsx @@ -10,10 +10,14 @@ import { companySituationSelector } from '@/store/selectors/simulationSelectors' export default function WrongSimulateurWarning() { const company = useSelector(companySituationSelector) - const simulatorData = useCurrentSimulatorData().currentSimulatorData as | PageConfig | undefined + + if (!company['entreprise . catégorie juridique']) { + return null + } + const isWrongSimulateur = simulatorData && simulatorData.codesCatégorieJuridique?.length && @@ -21,7 +25,7 @@ export default function WrongSimulateurWarning() { company['entreprise . code catégorie juridique'] as string ) < 0 - if (!Object.keys(company).length || !isWrongSimulateur) { + if (!isWrongSimulateur) { return null }