From 1421934f3cc2d2d7aa59eced0c61d998a2a9fbbf Mon Sep 17 00:00:00 2001 From: Ali Waseem Date: Thu, 22 Jan 2026 14:06:05 -0700 Subject: [PATCH] updated bug for edits --- apps/studio/components/grid/components/grid/Grid.utils.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/studio/components/grid/components/grid/Grid.utils.tsx b/apps/studio/components/grid/components/grid/Grid.utils.tsx index f20bf3737e2..89dcbc68e80 100644 --- a/apps/studio/components/grid/components/grid/Grid.utils.tsx +++ b/apps/studio/components/grid/components/grid/Grid.utils.tsx @@ -146,9 +146,11 @@ export function useOnRowsChange(rows: SupaRow[]) { const { columnName, previousValue, identifiers } = lastEdit const table = snap.originalTable - showUndoToast('Cell edit undone', snap.cellEditHistory.length, 'success') + // Optimistically show the remaining edit count assuming its complete + showUndoToast('Cell edit undone', snap.cellEditHistory.length - 1, 'success') - // Defer mutation to avoid conflicts with React's rendering cycle + // [Ali] Defer mutation to avoid conflicts with React's rendering cycle + // If I left it the same way the cancelled and rendering logic throws errors const roleState = getImpersonatedRoleState() setTimeout(() => { mutateUndoTableRow({