From c18089bf8ae1cfa2f9679a762fa3869f24f8daff Mon Sep 17 00:00:00 2001 From: xmflsct Date: Sun, 11 Dec 2022 12:12:46 +0100 Subject: [PATCH] Fixed #549 --- src/components/Timeline.tsx | 8 +++++++- src/screens/Tabs/Local/Root.tsx | 1 - src/screens/Tabs/Shared/Toot.tsx | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/Timeline.tsx b/src/components/Timeline.tsx index 1b98a665..5d89ff94 100644 --- a/src/components/Timeline.tsx +++ b/src/components/Timeline.tsx @@ -1,5 +1,6 @@ import ComponentSeparator from '@components/Separator' import { useScrollToTop } from '@react-navigation/native' +import { UseInfiniteQueryOptions } from '@tanstack/react-query' import { QueryKeyTimeline, useTimelineQuery } from '@utils/queryHooks/timeline' import { getInstanceActive } from '@utils/slices/instancesSlice' import { StyleConstants } from '@utils/styles/constants' @@ -17,15 +18,19 @@ const AnimatedFlatList = Animated.createAnimatedComponent(FlatList) export interface Props { flRef?: RefObject> queryKey: QueryKeyTimeline + queryOptions?: Omit< + UseInfiniteQueryOptions, + 'notifyOnChangeProps' | 'getNextPageParam' | 'getPreviousPageParam' | 'select' | 'onSuccess' + > disableRefresh?: boolean disableInfinity?: boolean - lookback?: Extract customProps: Partial> & Pick, 'renderItem'> } const Timeline: React.FC = ({ flRef: customFLRef, queryKey, + queryOptions, disableRefresh = false, disableInfinity = false, customProps @@ -36,6 +41,7 @@ const Timeline: React.FC = ({ useTimelineQuery({ ...queryKey[1], options: { + ...queryOptions, notifyOnChangeProps: Platform.select({ ios: ['dataUpdatedAt', 'isFetching'], android: ['dataUpdatedAt', 'isFetching', 'isLoading'] diff --git a/src/screens/Tabs/Local/Root.tsx b/src/screens/Tabs/Local/Root.tsx index f3da4ff4..0120fc1c 100644 --- a/src/screens/Tabs/Local/Root.tsx +++ b/src/screens/Tabs/Local/Root.tsx @@ -85,7 +85,6 @@ const Root: React.FC }} diff --git a/src/screens/Tabs/Shared/Toot.tsx b/src/screens/Tabs/Shared/Toot.tsx index 681992f3..6421a350 100644 --- a/src/screens/Tabs/Shared/Toot.tsx +++ b/src/screens/Tabs/Shared/Toot.tsx @@ -74,6 +74,7 @@ const TabSharedToot: React.FC> = ({ (