Added max filter.

This commit is contained in:
Ryan Breen
2023-02-15 21:34:31 -05:00
parent 3553871953
commit 79c379f2c2
2 changed files with 6 additions and 2 deletions

View File

@@ -28,7 +28,7 @@ export async function sortByIndex(index, query, asc, max) {
.openCursor(query, asc ? 'next' : 'prev');
while (cursor) {
events.push(cursor.value);
if (cursor.length >= max) {
if (events.length >= max) {
break;
}
cursor = await cursor.continue();