From 189409306d2aa1c1b60a51fdb76fe28ba4fd2d31 Mon Sep 17 00:00:00 2001 From: Alice Dahan Date: Mon, 3 Feb 2025 12:45:38 +0100 Subject: [PATCH] fix: affiche les questions lorsqu'un objectif est rempli --- site/source/store/selectors/simulationSelectors.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/site/source/store/selectors/simulationSelectors.ts b/site/source/store/selectors/simulationSelectors.ts index b3eb49bd8..f9930fdd7 100644 --- a/site/source/store/selectors/simulationSelectors.ts +++ b/site/source/store/selectors/simulationSelectors.ts @@ -1,4 +1,4 @@ -import { NonEmptyArray } from 'effect/Array' +import { intersection, NonEmptyArray } from 'effect/Array' import { createSelector } from 'reselect' import { isComparateurConfig } from '@/domaine/ComparateurConfig' @@ -54,13 +54,9 @@ export const rawSituationsSelonContextesSelector = createSelector( export const firstStepCompletedSelector = (state: RootState) => { const situation = situationSelector(state) + const objectifs = configObjectifsSelector(state) - return ( - Object.keys(situation).filter( - // Hack to prevent questions from showing after selection 'IR or IS' in the toggle above simulator - (dottedName) => dottedName !== 'entreprise . imposition' - ).length > 0 - ) + return intersection(objectifs, Object.keys(situation)).length > 0 } export const targetUnitSelector = (state: RootState) =>