From 8ab2a14b3c4d7279c4d1846a0cdf519d67234355 Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Mon, 7 Sep 2020 17:11:03 +0200 Subject: [PATCH] =?UTF-8?q?:art::bug:=20affiche=20la=20diff=C3=A9rence=20u?= =?UTF-8?q?niquement=20lorsque=20cela=20a=20du=20sens?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mon-entreprise/source/components/ui/AnimatedTargetValue.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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