File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -214,11 +214,21 @@ export function useTableUndo({
214214 if ( direction === 'undo' ) {
215215 deleteColumnMutation . mutate ( action . columnName , {
216216 onSuccess : ( ) => {
217+ const metadata : Record < string , unknown > = { }
217218 const currentWidths = getColumnWidthsRef . current ?.( ) ?? { }
218219 if ( action . columnName in currentWidths ) {
219220 const { [ action . columnName ] : _ , ...rest } = currentWidths
220221 onColumnWidthsChangeRef . current ?.( rest )
221- updateMetadataMutation . mutate ( { columnWidths : rest } )
222+ metadata . columnWidths = rest
223+ }
224+ const currentFrozen = getFrozenColumnsRef . current ?.( ) ?? [ ]
225+ if ( currentFrozen . includes ( action . columnName ) ) {
226+ const newFrozen = currentFrozen . filter ( ( n ) => n !== action . columnName )
227+ onFrozenColumnsChangeRef . current ?.( newFrozen )
228+ metadata . frozenColumns = newFrozen
229+ }
230+ if ( Object . keys ( metadata ) . length > 0 ) {
231+ updateMetadataMutation . mutate ( metadata )
222232 }
223233 } ,
224234 } )
You can’t perform that action at this time.
0 commit comments