Skip to content

Commit 333e0ab

Browse files
committed
fix: show all sorted entries when pagination is disabled
1 parent d429030 commit 333e0ab

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/decap-cms-core/src/reducers/entries.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -589,9 +589,12 @@ export function selectEntries(state: Entries, collection: Collection, configPage
589589

590590
if (sortedIdsRaw && List.isList(sortedIdsRaw)) {
591591
const sortedIds = sortedIdsRaw as List<string>;
592-
const start = (currentPage - 1) * pageSize;
593-
const end = start + pageSize;
594-
const pagedIds = sortedIds.slice(start, end);
592+
593+
// Only apply pagination if configPageSize is explicitly provided (meaning pagination is enabled)
594+
// If configPageSize is undefined, show all sorted entries
595+
const pagedIds = configPageSize !== undefined
596+
? sortedIds.slice((currentPage - 1) * pageSize, (currentPage - 1) * pageSize + pageSize)
597+
: sortedIds;
595598

596599
// Always look up entries from the global entities map to ensure correct order
597600
const entitiesMap = state.get('entities');

0 commit comments

Comments
 (0)