diff options
author | dan <dan.abramov@gmail.com> | 2023-11-10 19:00:46 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-10 19:00:46 +0000 |
commit | 65def371659c3b64481199b2585a40a1affd9ec2 (patch) | |
tree | 1fb92b4717fcfc82bdd476fdbcaa4ea80cb673bb /src/view/screens/ProfileFeed.tsx | |
parent | e0e5bc8fd850942b6749ad48d9ae087d99026996 (diff) | |
download | voidsky-65def371659c3b64481199b2585a40a1affd9ec2.tar.zst |
Push useAnimatedScrollHandler down everywhere to work around bugs (#1866)
* Move useOnMainScroll handlers to leaves * Force Feed to always take handlers * Pass handlers from the pager
Diffstat (limited to 'src/view/screens/ProfileFeed.tsx')
-rw-r--r-- | src/view/screens/ProfileFeed.tsx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/view/screens/ProfileFeed.tsx b/src/view/screens/ProfileFeed.tsx index 9c3c6d7ae..c1496e4ad 100644 --- a/src/view/screens/ProfileFeed.tsx +++ b/src/view/screens/ProfileFeed.tsx @@ -26,7 +26,7 @@ import {EmptyState} from 'view/com/util/EmptyState' import * as Toast from 'view/com/util/Toast' import {useSetTitle} from 'lib/hooks/useSetTitle' import {useCustomFeed} from 'lib/hooks/useCustomFeed' -import {OnScrollCb} from 'lib/hooks/useOnMainScroll' +import {OnScrollHandler} from 'lib/hooks/useOnMainScroll' import {shareUrl} from 'lib/sharing' import {toShareUrl} from 'lib/strings/url-helpers' import {Haptics} from 'lib/haptics' @@ -44,6 +44,7 @@ import {logger} from '#/logger' import {Trans, msg} from '@lingui/macro' import {useLingui} from '@lingui/react' import {useModalControls} from '#/state/modals' +import {useAnimatedScrollHandler} from '#/lib/hooks/useAnimatedScrollHandler_FIXED' const SECTION_TITLES = ['Posts', 'About'] @@ -383,7 +384,7 @@ export const ProfileFeedScreenInner = observer( interface FeedSectionProps { feed: PostsFeedModel - onScroll: OnScrollCb + onScroll: OnScrollHandler headerHeight: number isScrolledDown: boolean } @@ -443,10 +444,11 @@ const AboutSection = observer(function AboutPageImpl({ feedInfo: FeedSourceModel | undefined headerHeight: number onToggleLiked: () => void - onScroll: OnScrollCb + onScroll: OnScrollHandler }) { const pal = usePalette('default') const {_} = useLingui() + const scrollHandler = useAnimatedScrollHandler(onScroll) if (!feedInfo) { return <View /> @@ -456,7 +458,7 @@ const AboutSection = observer(function AboutPageImpl({ <ScrollView scrollEventThrottle={1} contentContainerStyle={{paddingTop: headerHeight}} - onScroll={onScroll}> + onScroll={scrollHandler}> <View style={[ { |