about summary refs log tree commit diff
path: root/src/state/queries
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2025-02-24 11:50:52 -0800
committerGitHub <noreply@github.com>2025-02-24 11:50:52 -0800
commitf9392d4a9688c1ea1bff962c857ff4ae543e46fe (patch)
treed84b3adc155c03e7519c0277a0e6a32366a76ea6 /src/state/queries
parentbdcddee7a568519073939e434f9e3973497b304c (diff)
downloadvoidsky-f9392d4a9688c1ea1bff962c857ff4ae543e46fe.tar.zst
Fix optimistic rendering of profile page (#7830)
* don't hold up rendering on starter packs

* add tab based on profile.associated

* move query into component, fix pending states
Diffstat (limited to 'src/state/queries')
-rw-r--r--src/state/queries/actor-starter-packs.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/state/queries/actor-starter-packs.ts b/src/state/queries/actor-starter-packs.ts
index 487bcdfd9..670544dfe 100644
--- a/src/state/queries/actor-starter-packs.ts
+++ b/src/state/queries/actor-starter-packs.ts
@@ -11,7 +11,13 @@ import {useAgent} from '#/state/session'
 export const RQKEY_ROOT = 'actor-starter-packs'
 export const RQKEY = (did?: string) => [RQKEY_ROOT, did]
 
-export function useActorStarterPacksQuery({did}: {did?: string}) {
+export function useActorStarterPacksQuery({
+  did,
+  enabled = true,
+}: {
+  did?: string
+  enabled?: boolean
+}) {
   const agent = useAgent()
 
   return useInfiniteQuery<
@@ -30,7 +36,7 @@ export function useActorStarterPacksQuery({did}: {did?: string}) {
       })
       return res.data
     },
-    enabled: Boolean(did),
+    enabled: Boolean(did) && enabled,
     initialPageParam: undefined,
     getNextPageParam: lastPage => lastPage.cursor,
   })