diff --git a/packages/desktop-client/src/components/ScrollProvider.tsx b/packages/desktop-client/src/components/ScrollProvider.tsx index 0fb730357e3..a7cb382f915 100644 --- a/packages/desktop-client/src/components/ScrollProvider.tsx +++ b/packages/desktop-client/src/components/ScrollProvider.tsx @@ -21,7 +21,9 @@ type ScrollListenerArgs = { type ScrollListener = (args: ScrollListenerArgs) => void; type UnregisterScrollListener = () => void; -type RegisterScrollListener = (listener: ScrollListener) => UnregisterScrollListener; +type RegisterScrollListener = ( + listener: ScrollListener, +) => UnregisterScrollListener; type IScrollContext = { registerScrollListener: RegisterScrollListener; @@ -176,13 +178,16 @@ export function ScrollProvider({ }); }, [hasScrolledToEnd, isDisabled, isScrolling, scrollableRef]); - const registerScrollListener: RegisterScrollListener = useCallback(listener => { - listeners.current.push(listener); + const registerScrollListener: RegisterScrollListener = useCallback( + listener => { + listeners.current.push(listener); - return () => { - listeners.current = listeners.current.filter(l => l !== listener); - }; - }, []); + return () => { + listeners.current = listeners.current.filter(l => l !== listener); + }; + }, + [], + ); return (