diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-02-24 11:50:52 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-24 11:50:52 -0800 |
commit | f9392d4a9688c1ea1bff962c857ff4ae543e46fe (patch) | |
tree | d84b3adc155c03e7519c0277a0e6a32366a76ea6 /src/state/queries | |
parent | bdcddee7a568519073939e434f9e3973497b304c (diff) | |
download | voidsky-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.ts | 10 |
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, }) |