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
This commit is contained in:
Samuel Newman
2025-02-24 11:50:52 -08:00
committed by GitHub
parent bdcddee7a5
commit f9392d4a96
5 changed files with 42 additions and 50 deletions
+8 -2
View File
@@ -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,
})