Limit max page size

This commit is contained in:
Zaid Abdulla committed 2020-09-28 12:47:56 -07:00
1 parent 1956441d52
commit 3fc0b1740d
1 file changed
+4 -1
+4 -1
View File
@@ -27,6 +27,8 @@ interface Attribute {
type?: string;
}
const MAX_PAGE_SIZE = 200;
function renderTable(
attributes: Attribute[],
data: Record<string, any>[],
@@ -180,7 +182,8 @@ function renderTable(
{
title: "Show more records",
onclick: showMoreCallback,
disabled: !data.length || records.length >= total,
disabled:
!data.length || records.length >= Math.min(MAX_PAGE_SIZE, total),
},
"More"
)