about summary refs log tree commit diff
path: root/src/view/screens/ProfileList.tsx
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2023-11-22 04:25:11 +0000
committerGitHub <noreply@github.com>2023-11-22 04:25:11 +0000
commit08333002cc4589c225c8fb82112d7059c334bfeb (patch)
tree81c3b590426de7d7d065eab4be07ab34165f7a62 /src/view/screens/ProfileList.tsx
parent3de1d556a9e1a782ef1103251685d9693312c8d8 (diff)
downloadvoidsky-08333002cc4589c225c8fb82112d7059c334bfeb.tar.zst
Implement "scroll to top" for profile tabs (#1973)
* Hook up scroll to top handlers

* Scroll and invalidate Feeds/Lists

* Fix index calc due to conditional tabs

* Reorder lines for clarity
Diffstat (limited to 'src/view/screens/ProfileList.tsx')
-rw-r--r--src/view/screens/ProfileList.tsx3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/view/screens/ProfileList.tsx b/src/view/screens/ProfileList.tsx
index b5a650643..a8c55250f 100644
--- a/src/view/screens/ProfileList.tsx
+++ b/src/view/screens/ProfileList.tsx
@@ -143,8 +143,7 @@ function ProfileListScreenLoaded({
     (index: number) => {
       if (index === 0) {
         feedSectionRef.current?.scrollToTop()
-      }
-      if (index === 1) {
+      } else if (index === 1) {
         aboutSectionRef.current?.scrollToTop()
       }
     },