fix: PaginatedList does not always load more (#4811)
This commit is contained in:
@@ -99,7 +99,7 @@ class PaginatedList<T extends PaginatedItem> extends React.Component<Props<T>> {
|
||||
}
|
||||
this.isFetching = true;
|
||||
const counter = ++this.fetchCounter;
|
||||
const limit = DEFAULT_PAGINATION_LIMIT;
|
||||
const limit = this.props.options?.limit ?? DEFAULT_PAGINATION_LIMIT;
|
||||
this.error = undefined;
|
||||
|
||||
try {
|
||||
|
||||
@@ -43,15 +43,13 @@ function Collections() {
|
||||
}),
|
||||
});
|
||||
|
||||
React.useEffect(() => {
|
||||
collections.fetchPage({ limit: 100 });
|
||||
}, [collections]);
|
||||
|
||||
return (
|
||||
<Flex column>
|
||||
<Header id="collections" title={t("Collections")}>
|
||||
<Relative>
|
||||
<PaginatedList
|
||||
fetch={collections.fetchPage}
|
||||
options={{ limit: 25 }}
|
||||
aria-label={t("Collections")}
|
||||
items={collections.orderedData}
|
||||
loading={<PlaceholderCollections />}
|
||||
|
||||
@@ -760,7 +760,10 @@ router.post(
|
||||
method: ["withMembership", user.id],
|
||||
}).findAll({
|
||||
where,
|
||||
order: [["updatedAt", "DESC"]],
|
||||
order: [
|
||||
Sequelize.literal('"collection"."index" collate "C"'),
|
||||
["updatedAt", "DESC"],
|
||||
],
|
||||
offset: ctx.state.pagination.offset,
|
||||
limit: ctx.state.pagination.limit,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user