[Refactoring] Rename isAutoUnfreezeDisabled -> noAutoFreeze (#1472)

This commit is contained in:
Alexander Zinchuk 2021-09-28 15:42:39 +03:00
parent 2dcf951f4c
commit 49673e4b0b
2 changed files with 5 additions and 5 deletions

View File

@ -31,7 +31,7 @@ export default function useMessageObservers(
} = useIntersectionObserver({
rootRef: containerRef,
throttleMs: INTERSECTION_THROTTLE_FOR_READING,
isAutoUnfreezeDisabled: true,
noAutoFreeze: true,
}, (entries) => {
if (type !== 'thread') {
return;

View File

@ -32,7 +32,7 @@ export function useIntersectionObserver({
margin,
threshold,
isDisabled,
isAutoUnfreezeDisabled = false,
noAutoFreeze = false,
}: {
rootRef: RefObject<HTMLDivElement>;
throttleMs?: number;
@ -41,7 +41,7 @@ export function useIntersectionObserver({
margin?: number;
threshold?: number | number[];
isDisabled?: boolean;
isAutoUnfreezeDisabled?: boolean;
noAutoFreeze?: boolean;
}, rootCallback?: RootCallback): Response {
const controllerRef = useRef<IntersectionController>();
const rootCallbackRef = useRef<RootCallback>();
@ -67,7 +67,7 @@ export function useIntersectionObserver({
const freeze = useCallback(() => {
freezeFlagsRef.current++;
if (isAutoUnfreezeDisabled) {
if (noAutoFreeze) {
return;
}
@ -87,7 +87,7 @@ export function useIntersectionObserver({
freezeFlagsRef.current = 1;
unfreeze();
}, AUTO_UNFREEZE_TIMEOUT);
}, [isAutoUnfreezeDisabled, unfreeze]);
}, [noAutoFreeze, unfreeze]);
useHeavyAnimationCheck(freeze, unfreeze);