about summary refs log tree commit diff
path: root/src/state/queries/profile-follows.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/queries/profile-follows.ts')
-rw-r--r--src/state/queries/profile-follows.ts13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/state/queries/profile-follows.ts b/src/state/queries/profile-follows.ts
index 23c0dce3e..1919409c7 100644
--- a/src/state/queries/profile-follows.ts
+++ b/src/state/queries/profile-follows.ts
@@ -16,7 +16,16 @@ type RQPageParam = string | undefined
 const RQKEY_ROOT = 'profile-follows'
 export const RQKEY = (did: string) => [RQKEY_ROOT, did]
 
-export function useProfileFollowsQuery(did: string | undefined) {
+export function useProfileFollowsQuery(
+  did: string | undefined,
+  {
+    limit,
+  }: {
+    limit?: number
+  } = {
+    limit: PAGE_SIZE,
+  },
+) {
   const {getAgent} = useAgent()
   return useInfiniteQuery<
     AppBskyGraphGetFollows.OutputSchema,
@@ -30,7 +39,7 @@ export function useProfileFollowsQuery(did: string | undefined) {
     async queryFn({pageParam}: {pageParam: RQPageParam}) {
       const res = await getAgent().app.bsky.graph.getFollows({
         actor: did || '',
-        limit: PAGE_SIZE,
+        limit: limit || PAGE_SIZE,
         cursor: pageParam,
       })
       return res.data