diff --git a/packages/desktop-client/src/components/ScrollProvider.tsx b/packages/desktop-client/src/components/ScrollProvider.tsx index fa9248b0ba4..159f747ace3 100644 --- a/packages/desktop-client/src/components/ScrollProvider.tsx +++ b/packages/desktop-client/src/components/ScrollProvider.tsx @@ -190,10 +190,10 @@ export function ScrollProvider({ ); } -export function useScrollEffect(listener: ScrollListener) { +export function useScrollListener(listener: ScrollListener) { const context = useContext(ScrollContext); if (!context) { - throw new Error('useScrollEffect must be used within a ScrollProvider'); + throw new Error('useScrollListener must be used within a ScrollProvider'); } const { registerListener, unregisterListener } = context; diff --git a/packages/desktop-client/src/components/mobile/MobileNavTabs.tsx b/packages/desktop-client/src/components/mobile/MobileNavTabs.tsx index a1f4c9e212e..8ce3aaeeac9 100644 --- a/packages/desktop-client/src/components/mobile/MobileNavTabs.tsx +++ b/packages/desktop-client/src/components/mobile/MobileNavTabs.tsx @@ -18,7 +18,7 @@ import { SvgCalendar } from '../../icons/v2'; import { useResponsive } from '../../ResponsiveProvider'; import { theme, styles } from '../../style'; import { View } from '../common/View'; -import { useScrollEffect } from '../ScrollProvider'; +import { useScrollListener } from '../ScrollProvider'; const COLUMN_COUNT = 3; const PILL_HEIGHT = 15; @@ -123,7 +123,7 @@ export function MobileNavTabs() { }); }; - useScrollEffect(({ isScrolling }) => { + useScrollListener(({ isScrolling }) => { if (isScrolling('down')) { hide(); } else { diff --git a/packages/desktop-client/src/components/mobile/transactions/ListBox.jsx b/packages/desktop-client/src/components/mobile/transactions/ListBox.jsx index c1c9c476ad2..f06a730f5e8 100644 --- a/packages/desktop-client/src/components/mobile/transactions/ListBox.jsx +++ b/packages/desktop-client/src/components/mobile/transactions/ListBox.jsx @@ -2,7 +2,7 @@ import React, { useRef } from 'react'; import { useListBox } from 'react-aria'; import { useListState } from 'react-stately'; -import { useScrollEffect } from '../../ScrollProvider'; +import { useScrollListener } from '../../ScrollProvider'; import { ListBoxSection } from './ListBoxSection'; @@ -12,7 +12,7 @@ export function ListBox(props) { const { listBoxProps, labelProps } = useListBox(props, state, listBoxRef); const { loadMore } = props; - useScrollEffect(({ hasScrolledToEnd }) => { + useScrollListener(({ hasScrolledToEnd }) => { const scrolledToBottom = hasScrolledToEnd('down', 5); if (scrolledToBottom) { loadMore?.();