diff options
Diffstat (limited to 'src/view/com')
-rw-r--r-- | src/view/com/feeds/FeedPage.tsx | 6 | ||||
-rw-r--r-- | src/view/com/feeds/ProfileFeedgens.tsx | 6 | ||||
-rw-r--r-- | src/view/com/lists/ProfileLists.tsx | 6 |
3 files changed, 15 insertions, 3 deletions
diff --git a/src/view/com/feeds/FeedPage.tsx b/src/view/com/feeds/FeedPage.tsx index 3624e6565..31ebc75a1 100644 --- a/src/view/com/feeds/FeedPage.tsx +++ b/src/view/com/feeds/FeedPage.tsx @@ -25,6 +25,7 @@ import {useComposerControls} from '#/state/shell/composer' import {listenSoftReset, emitSoftReset} from '#/state/events' import {truncateAndInvalidate} from '#/state/queries/util' import {TabState, getTabState, getRootNavigation} from '#/lib/routes/helpers' +import {isNative} from '#/platform/detection' const POLL_FREQ = 30e3 // 30sec @@ -57,7 +58,10 @@ export function FeedPage({ const [hasNew, setHasNew] = React.useState(false) const scrollToTop = React.useCallback(() => { - scrollElRef.current?.scrollToOffset({offset: -headerOffset}) + scrollElRef.current?.scrollToOffset({ + animated: isNative, + offset: -headerOffset, + }) resetMainScroll() }, [headerOffset, resetMainScroll]) 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]) 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]) |