about summary refs log tree commit diff
path: root/src/view/com/feeds/ProfileFeedgens.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/feeds/ProfileFeedgens.tsx
parentf115969f50b7f699696e71faabb4ae307177572e (diff)
downloadvoidsky-940fc0ea5c3aefb49f39d8de9398a306882ed567.tar.zst
Disable animation on scrollToTop for web (#2137)
Diffstat (limited to 'src/view/com/feeds/ProfileFeedgens.tsx')
-rw-r--r--src/view/com/feeds/ProfileFeedgens.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/view/com/feeds/ProfileFeedgens.tsx b/src/view/com/feeds/ProfileFeedgens.tsx
index 618f4e5cd..cadd3bd88 100644
--- a/src/view/com/feeds/ProfileFeedgens.tsx
+++ b/src/view/com/feeds/ProfileFeedgens.tsx
@@ -24,6 +24,7 @@ import {useTheme} from '#/lib/ThemeContext'
 import {usePreferencesQuery} from '#/state/queries/preferences'
 import {hydrateFeedGenerator} from '#/state/queries/feed'
 import {FeedLoadingPlaceholder} from '#/view/com/util/LoadingPlaceholder'
+import {isNative} from '#/platform/detection'
 
 const LOADING = {_reactKey: '__loading__'}
 const EMPTY = {_reactKey: '__empty__'}
@@ -104,7 +105,10 @@ export const ProfileFeedgens = React.forwardRef<
   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])