Skip to content

Commit 3154ed1

Browse files
committed
fix: stricter infinite measure detection
1 parent 65fd5f3 commit 3154ed1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/AxisLinear.useMeasure.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ const getElBox = el => {
1717
};
1818

1919
function useIsLooping() {
20-
const callThreshold = 60;
21-
const timeLimit = 1000;
20+
const callThreshold = 30;
21+
const timeLimit = 500;
2222
const now = Date.now();
2323

2424
const ref = React.useRef([now]);
@@ -32,7 +32,7 @@ function useIsLooping() {
3232
}
3333

3434
const isLooping =
35-
ref.current.length >= callThreshold && now - ref.current[0] < timeLimit;
35+
ref.current.length === callThreshold && now - ref.current[0] < timeLimit;
3636

3737
return isLooping;
3838
}

0 commit comments

Comments
 (0)