about summary refs log tree commit diff
path: root/src/view/com/lists/ProfileLists.tsx
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-12-07 13:41:02 -0800
committerGitHub <noreply@github.com>2023-12-07 13:41:02 -0800
commit940fc0ea5c3aefb49f39d8de9398a306882ed567 (patch)
tree98b21e161808c011a84b858324778119aca37941 /src/view/com/lists/ProfileLists.tsx
parentf115969f50b7f699696e71faabb4ae307177572e (diff)
downloadvoidsky-940fc0ea5c3aefb49f39d8de9398a306882ed567.tar.zst
Disable animation on scrollToTop for web (#2137)
Diffstat (limited to 'src/view/com/lists/ProfileLists.tsx')
-rw-r--r--src/view/com/lists/ProfileLists.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/view/com/lists/ProfileLists.tsx b/src/view/com/lists/ProfileLists.tsx
index 95cf8fde6..0609c0e21 100644
--- a/src/view/com/lists/ProfileLists.tsx
+++ b/src/view/com/lists/ProfileLists.tsx
@@ -23,6 +23,7 @@ import {cleanError} from '#/lib/strings/errors'
 import {useAnimatedScrollHandler} from 'react-native-reanimated'
 import {useTheme} from '#/lib/ThemeContext'
 import {FeedLoadingPlaceholder} from '#/view/com/util/LoadingPlaceholder'
+import {isNative} from '#/platform/detection'
 
 const LOADING = {_reactKey: '__loading__'}
 const EMPTY = {_reactKey: '__empty__'}
@@ -106,7 +107,10 @@ export const ProfileLists = React.forwardRef<SectionRef, ProfileListsProps>(
     const queryClient = useQueryClient()
 
     const onScrollToTop = React.useCallback(() => {
-      scrollElRef.current?.scrollToOffset({offset: -headerOffset})
+      scrollElRef.current?.scrollToOffset({
+        animated: isNative,
+        offset: -headerOffset,
+      })
       queryClient.invalidateQueries({queryKey: RQKEY(did)})
     }, [scrollElRef, queryClient, headerOffset, did])