[Refactoring] Fix naming

This commit is contained in:
Alexander Zinchuk 2021-06-13 16:27:34 +03:00
parent d22e46ee51
commit 38347de359

View File

@ -23,10 +23,10 @@ type OwnProps = {
}; };
const FAB_THRESHOLD = 50; const FAB_THRESHOLD = 50;
const FAB_FREEZE_TIMEOUT = 100; const TOOLS_FREEZE_TIMEOUT = 100;
// Local flag is used because `freeze/unfreeze` methods are controlled by heavy animation // Local flag is used because `freeze/unfreeze` methods are controlled by heavy animation
let isFabFrozen = false; let areToolsFrozen = false;
const MessageScroll: FC<OwnProps> = ({ const MessageScroll: FC<OwnProps> = ({
containerRef, containerRef,
@ -49,7 +49,7 @@ const MessageScroll: FC<OwnProps> = ({
const fabTriggerRef = useRef<HTMLDivElement>(null); const fabTriggerRef = useRef<HTMLDivElement>(null);
const toggleScrollTools = useCallback(() => { const toggleScrollTools = useCallback(() => {
if (isFabFrozen) { if (areToolsFrozen) {
return; return;
} }
@ -135,13 +135,13 @@ const MessageScroll: FC<OwnProps> = ({
} }
}, [focusingId]); }, [focusingId]);
// Workaround for FAB flickering with tall incoming message // Workaround for FAB and notch flickering with tall incoming message
useOnChange(() => { useOnChange(() => {
isFabFrozen = true; areToolsFrozen = true;
setTimeout(() => { setTimeout(() => {
isFabFrozen = false; areToolsFrozen = false;
}, FAB_FREEZE_TIMEOUT); }, TOOLS_FREEZE_TIMEOUT);
}, [messageIds]); }, [messageIds]);
// Workaround for stuck FAB when many unread messages // Workaround for stuck FAB when many unread messages