about summary refs log tree commit diff
path: root/src/state/queries/profile-lists.ts
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-11-13 15:12:41 -0800
committerGitHub <noreply@github.com>2023-11-13 15:12:41 -0800
commit0501c2be778b1a8517da6ea4111bcbd56dc056ed (patch)
tree76066acea69eb12125777e646038512bfd7d016d /src/state/queries/profile-lists.ts
parent47204d955162ace471315beeadcd21b0017543ad (diff)
downloadvoidsky-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.ts4
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,
   })
 }