From 015a5eece280eca817677add883141a5abaf82a3 Mon Sep 17 00:00:00 2001 From: mertmit Date: Tue, 28 Mar 2023 00:23:41 +0300 Subject: [PATCH] fix: sync row count on row delete by undo/redo Signed-off-by: mertmit --- packages/nc-gui/composables/useViewData.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/nc-gui/composables/useViewData.ts b/packages/nc-gui/composables/useViewData.ts index bcce865df4..bc61ea3b81 100644 --- a/packages/nc-gui/composables/useViewData.ts +++ b/packages/nc-gui/composables/useViewData.ts @@ -304,6 +304,7 @@ export function useViewData( fn: async function undo(this: UndoRedoAction, id: string) { await deleteRowById(id) if (rowIndex) formattedData.value.splice(rowIndex, 1) + paginationData.value.totalRows = paginationData.value.totalRows! - 1 }, args: [id], }, @@ -507,6 +508,7 @@ export function useViewData( const pk: Record = rowPkData(row.row, meta?.value?.columns as ColumnType[]) const rowIndex = findIndexByPk(pk) if (rowIndex) formattedData.value.splice(rowIndex, 1) + paginationData.value.totalRows = paginationData.value.totalRows! - 1 }, args: [id], },