From 4de852ded83fd7f2445040792184ab83eab1e5e4 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Fri, 3 Nov 2023 14:53:47 -0700 Subject: [PATCH] Refresh on scroll-to-top by active section press (#1807) --- src/view/screens/ProfileFeed.tsx | 8 ++------ src/view/screens/ProfileList.tsx | 9 ++------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/view/screens/ProfileFeed.tsx b/src/view/screens/ProfileFeed.tsx index 70e52bf7aa..3607ef82dc 100644 --- a/src/view/screens/ProfileFeed.tsx +++ b/src/view/screens/ProfileFeed.tsx @@ -393,12 +393,8 @@ const FeedSection = React.forwardRef( const onScrollToTop = useCallback(() => { scrollElRef.current?.scrollToOffset({offset: -headerHeight}) - }, [scrollElRef, headerHeight]) - - const onPressLoadLatest = React.useCallback(() => { - onScrollToTop() feed.refresh() - }, [feed, onScrollToTop]) + }, [feed, scrollElRef, headerHeight]) React.useImperativeHandle(ref, () => ({ scrollToTop: onScrollToTop, @@ -420,7 +416,7 @@ const FeedSection = React.forwardRef( /> {(isScrolledDown || hasNew) && ( diff --git a/src/view/screens/ProfileList.tsx b/src/view/screens/ProfileList.tsx index 4fc4b6c7f5..28c69a90e8 100644 --- a/src/view/screens/ProfileList.tsx +++ b/src/view/screens/ProfileList.tsx @@ -558,13 +558,8 @@ const FeedSection = React.forwardRef( const onScrollToTop = useCallback(() => { scrollElRef.current?.scrollToOffset({offset: -headerHeight}) - }, [scrollElRef, headerHeight]) - - const onPressLoadLatest = React.useCallback(() => { - onScrollToTop() feed.refresh() - }, [feed, onScrollToTop]) - + }, [feed, scrollElRef, headerHeight]) React.useImperativeHandle(ref, () => ({ scrollToTop: onScrollToTop, })) @@ -586,7 +581,7 @@ const FeedSection = React.forwardRef( /> {(isScrolledDown || hasNew) && (