tangled
alpha
login
or
join now
mary.my.id
/
aglais
4
fork
atom
personal web client for Bluesky
typescript
solidjs
bluesky
atcute
4
fork
atom
overview
issues
pulls
pipelines
fix: better pagination check
mary.my.id
1 month ago
325fb21b
24df5fa7
verified
This commit was signed with the committer's
known signature
.
mary.my.id
SSH Key Fingerprint:
SHA256:ZlTP/auFSGpGnaoDg4mCTG1g9OZvXp62jWR4c6H4O3c=
+13
-2
1 changed file
expand all
collapse all
unified
split
src
api
queries
bookmark.ts
+13
-2
src/api/queries/bookmark.ts
···
26
26
);
27
27
28
28
return {
29
29
-
cursor: data.bookmarks.length !== 0 ? data.cursor : undefined,
29
29
+
cursor: data.cursor,
30
30
bookmarks: data.bookmarks,
31
31
};
32
32
},
33
33
structuralSharing: false,
34
34
initialPageParam: undefined,
35
35
-
getNextPageParam: (last) => last.cursor,
35
35
+
getNextPageParam: (last, all) => {
36
36
+
// stop pagination if the last 4 pages have no bookmarks
37
37
+
if (all.length >= 4) {
38
38
+
const recentPages = all.slice(-4);
39
39
+
const allEmpty = recentPages.every((page) => page.bookmarks.length === 0);
40
40
+
if (allEmpty) {
41
41
+
return undefined;
42
42
+
}
43
43
+
}
44
44
+
45
45
+
return last.cursor;
46
46
+
},
36
47
};
37
48
});
38
49
};