🎨 affiche un résultat pour artiste auteur même quand 0€ est entré

pull/841/head
Johan Girod 2020-01-14 11:30:39 +01:00
parent 90e42a8b47
commit 36c5583190
1 changed files with 7 additions and 2 deletions

View File

@ -10,7 +10,11 @@ import React, { useEffect, useState } from 'react'
import NumberFormat from 'react-number-format'
import { useDispatch, useSelector } from 'react-redux'
import { RootState } from 'Reducers/rootReducer'
import { analysisWithDefaultsSelector, ruleAnalysisSelector, situationSelector } from 'Selectors/analyseSelectors'
import {
analysisWithDefaultsSelector,
ruleAnalysisSelector,
situationSelector
} from 'Selectors/analyseSelectors'
import styled from 'styled-components'
import { DottedName } from 'Types/rule'
import Animate from 'Ui/animate'
@ -169,10 +173,11 @@ const ResultLabel = styled.div`
function CotisationsResult() {
const [display, setDisplay] = useState(false)
const situation = useSelector(situationSelector)
const cotisationRule = useRule('artiste-auteur . cotisations')
const value = cotisationRule.nodeValue
if (value && !display) {
if (Object.keys(situation).length && !display) {
setDisplay(true)
}