diff --git a/mon-entreprise/source/components/ui/AnimatedTargetValue.tsx b/mon-entreprise/source/components/ui/AnimatedTargetValue.tsx index 0f7f0b4f1..d68fa4221 100644 --- a/mon-entreprise/source/components/ui/AnimatedTargetValue.tsx +++ b/mon-entreprise/source/components/ui/AnimatedTargetValue.tsx @@ -33,9 +33,11 @@ export default function AnimatedTargetValue({ ? null : (value || 0) - (previousValue.current || 0) const shouldDisplayDifference = - difference !== null && + difference != null && previousUnit.current === currentUnit && - Math.abs(difference) > 1 + Math.abs(difference) > 1 && + previousValue.current != null && + value != null previousValue.current = value previousUnit.current = currentUnit