diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-11-13 15:12:41 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-13 15:12:41 -0800 |
commit | 0501c2be778b1a8517da6ea4111bcbd56dc056ed (patch) | |
tree | 76066acea69eb12125777e646038512bfd7d016d /src/view/com/lists/ProfileLists.tsx | |
parent | 47204d955162ace471315beeadcd21b0017543ad (diff) | |
download | voidsky-0501c2be778b1a8517da6ea4111bcbd56dc056ed.tar.zst |
Profile cleanup (react-query refactor) (#1891)
* Only fetch profile tab content when focused * Fix keys * Add missing behaviors to post tabs * Delete old profile mobx model
Diffstat (limited to 'src/view/com/lists/ProfileLists.tsx')
-rw-r--r-- | src/view/com/lists/ProfileLists.tsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/view/com/lists/ProfileLists.tsx b/src/view/com/lists/ProfileLists.tsx index a92af9f3c..ed42a2607 100644 --- a/src/view/com/lists/ProfileLists.tsx +++ b/src/view/com/lists/ProfileLists.tsx @@ -34,6 +34,7 @@ export function ProfileLists({ onScroll, scrollEventThrottle, headerOffset, + enabled, style, testID, }: { @@ -42,6 +43,7 @@ export function ProfileLists({ onScroll?: OnScrollHandler scrollEventThrottle?: number headerOffset: number + enabled?: boolean style?: StyleProp<ViewStyle> testID?: string }) { @@ -49,6 +51,7 @@ export function ProfileLists({ const theme = useTheme() const {track} = useAnalytics() const [isPTRing, setIsPTRing] = React.useState(false) + const opts = React.useMemo(() => ({enabled}), [enabled]) const { data, isFetching, @@ -58,7 +61,7 @@ export function ProfileLists({ isError, error, refetch, - } = useProfileListsQuery(did) + } = useProfileListsQuery(did, opts) const isEmpty = !isFetching && !data?.pages[0]?.lists.length const items = React.useMemo(() => { |