mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Auto-scroll the left pane less frequently
This commit is contained in:
@@ -9,6 +9,7 @@ import React, {
|
||||
ReactNode,
|
||||
} from 'react';
|
||||
|
||||
import { usePrevious } from '../util/hooks';
|
||||
import { scrollToBottom } from '../util/scrollToBottom';
|
||||
|
||||
type PropsType = {
|
||||
@@ -19,9 +20,7 @@ export const ContactPills: FunctionComponent<PropsType> = ({ children }) => {
|
||||
const elRef = useRef<null | HTMLDivElement>(null);
|
||||
|
||||
const childCount = Children.count(children);
|
||||
const previousChildCountRef = useRef<number>(childCount);
|
||||
const previousChildCount = previousChildCountRef.current;
|
||||
previousChildCountRef.current = childCount;
|
||||
const previousChildCount = usePrevious(0, childCount);
|
||||
|
||||
useEffect(() => {
|
||||
const hasAddedNewChild = childCount > previousChildCount;
|
||||
|
||||
Reference in New Issue
Block a user