tangled
alpha
login
or
join now
cosmik.network
/
semble
43
fork
atom
A social knowledge tool for researchers built on ATProto
43
fork
atom
overview
issues
13
pulls
pipelines
fix: collection query keys
Pouria Delfanazari
4 months ago
8227ed2e
c308e145
+8
-3
3 changed files
expand all
collapse all
unified
split
src
webapp
features
collections
lib
collectionKeys.ts
queries
useCollection.tsx
useCollections.tsx
+6
-1
src/webapp/features/collections/lib/collectionKeys.ts
···
4
4
mine: () => [...collectionKeys.all(), 'mine'] as const,
5
5
search: (query: string) => [...collectionKeys.all(), 'search', query],
6
6
bySembleUrl: (url: string) => [...collectionKeys.all(), url],
7
7
-
infinite: (id?: string) => [...collectionKeys.all(), 'infinite', id],
7
7
+
infinite: (id?: string, limit?: number) => [
8
8
+
...collectionKeys.all(),
9
9
+
'infinite',
10
10
+
id,
11
11
+
limit,
12
12
+
],
8
13
};
+1
-1
src/webapp/features/collections/lib/queries/useCollection.tsx
···
12
12
const limit = props.limit ?? 20;
13
13
14
14
return useSuspenseInfiniteQuery({
15
15
-
queryKey: collectionKeys.infinite(props.rkey),
15
15
+
queryKey: collectionKeys.infinite(props.rkey, props.limit),
16
16
initialPageParam: 1,
17
17
queryFn: ({ pageParam }) =>
18
18
getCollectionPageByAtUri({
+1
-1
src/webapp/features/collections/lib/queries/useCollections.tsx
···
11
11
const limit = props?.limit ?? 15;
12
12
13
13
return useSuspenseInfiniteQuery({
14
14
-
queryKey: collectionKeys.infinite(props.didOrHandle),
14
14
+
queryKey: collectionKeys.infinite(props.didOrHandle, props.limit),
15
15
initialPageParam: 1,
16
16
queryFn: ({ pageParam }) =>
17
17
getCollections(props.didOrHandle, {