Répare un bug sur la page association du choix du statut

pull/2869/head
Johan Girod 2023-09-29 18:43:20 +02:00
parent 42ea5b593e
commit 0d74d2c6fc
1 changed files with 7 additions and 8 deletions

View File

@ -1,4 +1,4 @@
import { useEffect, useMemo } from 'react'
import { useEffect } from 'react'
import { Trans, useTranslation } from 'react-i18next'
import { useDispatch } from 'react-redux'
@ -102,6 +102,7 @@ export default function Association() {
}
type RadioOption = 'gagner-argent' | 'non-lucratif' | undefined
function useAssociationSelection(): [
RadioOption,
(value: RadioOption) => void,
@ -115,13 +116,11 @@ function useAssociationSelection(): [
const dispatch = useDispatch()
const engine = useEngine()
const associationPossible = useMemo(
() =>
engine.evaluate({
'est applicable': 'entreprise . catégorie juridique . association',
}).nodeValue === true,
[]
)
const associationPossible =
engine.evaluate('entreprise . catégorie juridique . association')
.nodeValue !== null
const handleChange = (value: RadioOption) => {
setCurrentSelection({ state: value })
if (!associationPossible) return