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