🎨🐛 affiche la différence uniquement lorsque cela a du sens
parent
28f07e9111
commit
8ab2a14b3c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue