Skip to content

Commit c3bd25e

Browse files
committed
fix(tables): add missing useEffect import; chunk range-selection delete and cut
1 parent 86e9c58 commit c3bd25e

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,7 +1909,10 @@ export function TableGrid({
19091909
batchUpdates.push({ rowId: row.id, data: updates })
19101910
}
19111911
if (batchUpdates.length > 0) {
1912-
batchUpdateRef.current({ updates: batchUpdates })
1912+
void chunkBatchUpdates(batchUpdates, batchUpdateAsyncRef.current).catch((error) => {
1913+
logger.error('Failed to clear selected cells', { error })
1914+
toast.error('Failed to clear cells — please try again')
1915+
})
19131916
}
19141917
if (undoCells.length > 0) {
19151918
pushUndoRef.current({ type: 'clear-cells', cells: undoCells })
@@ -2083,7 +2086,10 @@ export function TableGrid({
20832086
}
20842087
e.clipboardData?.setData('text/plain', lines.join('\n'))
20852088
if (batchUpdates.length > 0) {
2086-
batchUpdateRef.current({ updates: batchUpdates })
2089+
void chunkBatchUpdates(batchUpdates, batchUpdateAsyncRef.current).catch((error) => {
2090+
logger.error('Failed to cut selected cells', { error })
2091+
toast.error('Failed to cut — please try again')
2092+
})
20872093
}
20882094
if (undoCells.length > 0) {
20892095
pushUndoRef.current({ type: 'clear-cells', cells: undoCells })

apps/sim/hooks/queries/tables.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* React Query hooks for managing user-defined tables.
55
*/
66

7-
import { useMemo } from 'react'
7+
import { useEffect, useMemo } from 'react'
88
import { createLogger } from '@sim/logger'
99
import {
1010
type InfiniteData,

0 commit comments

Comments
 (0)