From e3474d909619d458b22cd85bfe1d4e95d2cc9068 Mon Sep 17 00:00:00 2001 From: Ali Waseem Date: Thu, 22 Jan 2026 13:40:51 -0700 Subject: [PATCH] updated logic to show correct undo --- apps/studio/components/grid/components/grid/Grid.utils.tsx | 4 ++-- 1 file changed, 2 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 d217bfce668..c3e3aea564d 100644 --- a/apps/studio/components/grid/components/grid/Grid.utils.tsx +++ b/apps/studio/components/grid/components/grid/Grid.utils.tsx @@ -109,7 +109,7 @@ export function useOnRowsChange(rows: SupaRow[]) { } const remainingEdits = snap.cellEditHistory.length - if (remainingEdits > 0) { + if (remainingEdits > 1) { toastIdRef.current = toast.success('Cell edit undone', { description: `${remainingEdits} more edit${remainingEdits > 1 ? 's' : ''} can be undone`, action: { @@ -122,7 +122,7 @@ export function useOnRowsChange(rows: SupaRow[]) { toast.success('Cell edit undone') } - // Defer the mutation to avoid conflicts with React's rendering cycle + // [Ali] Defer the mutation to avoid conflicts with React's rendering cycle // This prevents "Canceled" errors when undo is triggered during other state updates const tableRef = snap.originalTable const roleState = getImpersonatedRoleState()