diff --git a/components/tablelist/TableList.tsx b/components/tablelist/TableList.tsx index 39b2e67..1640bf7 100644 --- a/components/tablelist/TableList.tsx +++ b/components/tablelist/TableList.tsx @@ -238,11 +238,13 @@ export const TableList: React.FC = ({ {"Loading..."} ); - if (typeof onCount === "function") { - const res = await onCount(); - local.count = res; - local.render(); - } + try { + if (typeof onCount === "function") { + const res = await onCount(); + local.count = res; + local.render(); + } + } catch (ex) {} if (mode === "form") { local.data = fm.data?.[name] || []; cloneListFM(fm.data?.[name] || []); @@ -264,6 +266,9 @@ export const TableList: React.FC = ({ if (!autoPagination) { res = paginateArray(res, take, 1); } + if (!local.count) { + local.count = res?.length; + } local.data = res; if (mode === "form") cloneListFM(res); local.render();