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:
@@ -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,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user