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/state/queries/profile-lists.ts | |
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/state/queries/profile-lists.ts')
-rw-r--r-- | src/state/queries/profile-lists.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/state/queries/profile-lists.ts b/src/state/queries/profile-lists.ts index a277a6d61..7d36af28c 100644 --- a/src/state/queries/profile-lists.ts +++ b/src/state/queries/profile-lists.ts @@ -7,8 +7,9 @@ type RQPageParam = string | undefined export const RQKEY = (did: string) => ['profile-lists', did] -export function useProfileListsQuery(did: string) { +export function useProfileListsQuery(did: string, opts?: {enabled?: boolean}) { const {agent} = useSession() + const enabled = opts?.enabled !== false return useInfiniteQuery< AppBskyGraphGetLists.OutputSchema, Error, @@ -27,5 +28,6 @@ export function useProfileListsQuery(did: string) { }, initialPageParam: undefined, getNextPageParam: lastPage => lastPage.cursor, + enabled, }) } |