🎨🐛 affiche la différence uniquement lorsque cela a du sens

pull/1114/head
Johan Girod 2020-09-07 17:11:03 +02:00
parent 28f07e9111
commit 8ab2a14b3c
1 changed files with 4 additions and 2 deletions

View File

@ -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