Browse Source

fix(nc-gui): expectedPage logic

pull/4435/head
Wing-Kam Wong 2 years ago
parent
commit
545c5875bb
  1. 4
      packages/nc-gui/composables/useViewData.ts

4
packages/nc-gui/composables/useViewData.ts

@ -192,8 +192,8 @@ export function useViewData(
// to cater the case like when querying with a non-zero offset // to cater the case like when querying with a non-zero offset
// the result page may point to the target page where the actual returned data don't display on // the result page may point to the target page where the actual returned data don't display on
const expectedPage = Math.ceil(paginationData.value.totalRows! / paginationData.value.pageSize!) const expectedPage = Math.max(1, Math.ceil(paginationData.value.totalRows! / paginationData.value.pageSize!))
if (Math.max(1, expectedPage) < paginationData.value.page!) { if (expectedPage < paginationData.value.page!) {
await changePage(expectedPage) await changePage(expectedPage)
} }

Loading…
Cancel
Save