about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/view/screens/ProfileFeed.tsx8
-rw-r--r--src/view/screens/ProfileList.tsx9
2 files changed, 4 insertions, 13 deletions
diff --git a/src/view/screens/ProfileFeed.tsx b/src/view/screens/ProfileFeed.tsx
index 70e52bf7a..3607ef82d 100644
--- a/src/view/screens/ProfileFeed.tsx
+++ b/src/view/screens/ProfileFeed.tsx
@@ -393,12 +393,8 @@ const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>(
 
     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<SectionRef, FeedSectionProps>(
         />
         {(isScrolledDown || hasNew) && (
           <LoadLatestBtn
-            onPress={onPressLoadLatest}
+            onPress={onScrollToTop}
             label="Load new posts"
             showIndicator={hasNew}
           />
diff --git a/src/view/screens/ProfileList.tsx b/src/view/screens/ProfileList.tsx
index 4fc4b6c7f..28c69a90e 100644
--- a/src/view/screens/ProfileList.tsx
+++ b/src/view/screens/ProfileList.tsx
@@ -558,13 +558,8 @@ const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>(
 
     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<SectionRef, FeedSectionProps>(
         />
         {(isScrolledDown || hasNew) && (
           <LoadLatestBtn
-            onPress={onPressLoadLatest}
+            onPress={onScrollToTop}
             label="Load new posts"
             showIndicator={hasNew}
           />