about summary refs log tree commit diff
path: root/src/state/queries/profile-feedgens.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-feedgens.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-feedgens.ts')
-rw-r--r--src/state/queries/profile-feedgens.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/state/queries/profile-feedgens.ts b/src/state/queries/profile-feedgens.ts
index 652a123d9..fc0c91c27 100644
--- a/src/state/queries/profile-feedgens.ts
+++ b/src/state/queries/profile-feedgens.ts
@@ -7,8 +7,12 @@ type RQPageParam = string | undefined
 
 export const RQKEY = (did: string) => ['profile-feedgens', did]
 
-export function useProfileFeedgensQuery(did: string) {
+export function useProfileFeedgensQuery(
+  did: string,
+  opts?: {enabled?: boolean},
+) {
   const {agent} = useSession()
+  const enabled = opts?.enabled !== false
   return useInfiniteQuery<
     AppBskyFeedGetActorFeeds.OutputSchema,
     Error,
@@ -27,5 +31,6 @@ export function useProfileFeedgensQuery(did: string) {
     },
     initialPageParam: undefined,
     getNextPageParam: lastPage => lastPage.cursor,
+    enabled,
   })
 }