Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fixed bug in counting-numbers utility

Steven Teyafb3b0b6e54c
diff --git a/components/shared/counting-numbers.tsx b/components/shared/counting-numbers.tsx
index 97d452c32f..a5d11af8e0 100644
--- a/components/shared/counting-numbers.tsx
+++ b/components/shared/counting-numbers.tsx
@@ -17,10 +17,10 @@ export default function CountingNumbers({
duration?: number;
}) {
const [number, setNumber] = useState(start);
- const increment =
- value < duration / interval
- ? 1
- : Math.floor(Math.abs(start - value) / (duration / interval));
+ let increment = Math.floor(Math.abs(start - value) / (duration / interval));
+ if (increment === 0) {
+ increment = 1;
+ }
const ref = useRef(null);
const isInView = useInView(ref);