mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-22 05:11:55 +01:00
[Refactoring] Rename isAutoUnfreezeDisabled
-> noAutoFreeze
(#1472)
This commit is contained in:
parent
2dcf951f4c
commit
49673e4b0b
@ -31,7 +31,7 @@ export default function useMessageObservers(
|
|||||||
} = useIntersectionObserver({
|
} = useIntersectionObserver({
|
||||||
rootRef: containerRef,
|
rootRef: containerRef,
|
||||||
throttleMs: INTERSECTION_THROTTLE_FOR_READING,
|
throttleMs: INTERSECTION_THROTTLE_FOR_READING,
|
||||||
isAutoUnfreezeDisabled: true,
|
noAutoFreeze: true,
|
||||||
}, (entries) => {
|
}, (entries) => {
|
||||||
if (type !== 'thread') {
|
if (type !== 'thread') {
|
||||||
return;
|
return;
|
||||||
|
@ -32,7 +32,7 @@ export function useIntersectionObserver({
|
|||||||
margin,
|
margin,
|
||||||
threshold,
|
threshold,
|
||||||
isDisabled,
|
isDisabled,
|
||||||
isAutoUnfreezeDisabled = false,
|
noAutoFreeze = false,
|
||||||
}: {
|
}: {
|
||||||
rootRef: RefObject<HTMLDivElement>;
|
rootRef: RefObject<HTMLDivElement>;
|
||||||
throttleMs?: number;
|
throttleMs?: number;
|
||||||
@ -41,7 +41,7 @@ export function useIntersectionObserver({
|
|||||||
margin?: number;
|
margin?: number;
|
||||||
threshold?: number | number[];
|
threshold?: number | number[];
|
||||||
isDisabled?: boolean;
|
isDisabled?: boolean;
|
||||||
isAutoUnfreezeDisabled?: boolean;
|
noAutoFreeze?: boolean;
|
||||||
}, rootCallback?: RootCallback): Response {
|
}, rootCallback?: RootCallback): Response {
|
||||||
const controllerRef = useRef<IntersectionController>();
|
const controllerRef = useRef<IntersectionController>();
|
||||||
const rootCallbackRef = useRef<RootCallback>();
|
const rootCallbackRef = useRef<RootCallback>();
|
||||||
@ -67,7 +67,7 @@ export function useIntersectionObserver({
|
|||||||
const freeze = useCallback(() => {
|
const freeze = useCallback(() => {
|
||||||
freezeFlagsRef.current++;
|
freezeFlagsRef.current++;
|
||||||
|
|
||||||
if (isAutoUnfreezeDisabled) {
|
if (noAutoFreeze) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ export function useIntersectionObserver({
|
|||||||
freezeFlagsRef.current = 1;
|
freezeFlagsRef.current = 1;
|
||||||
unfreeze();
|
unfreeze();
|
||||||
}, AUTO_UNFREEZE_TIMEOUT);
|
}, AUTO_UNFREEZE_TIMEOUT);
|
||||||
}, [isAutoUnfreezeDisabled, unfreeze]);
|
}, [noAutoFreeze, unfreeze]);
|
||||||
|
|
||||||
useHeavyAnimationCheck(freeze, unfreeze);
|
useHeavyAnimationCheck(freeze, unfreeze);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user