mirror of
https://github.com/supabase/supabase.git
synced 2026-10-11 20:35:07 +03:00
updated logic to show correct undo
This commit is contained in:
1 parent
188b9b8d30
commit
e3474d9096
1 file changed
+2
-2
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user