@@ -25,13 +25,6 @@ interface CodeUndoRedoState {
2525 undo : ( workflowId : string , blockId : string , subBlockId : string ) => CodeUndoRedoEntry | null
2626 redo : ( workflowId : string , blockId : string , subBlockId : string ) => CodeUndoRedoEntry | null
2727 clear : ( workflowId : string , blockId : string , subBlockId : string ) => void
28- clearRedo : ( workflowId : string , blockId : string , subBlockId : string ) => void
29- getStackSizes : (
30- workflowId : string ,
31- blockId : string ,
32- subBlockId : string
33- ) => { undoSize : number ; redoSize : number }
34- reset : ( ) => void
3528}
3629
3730const DEFAULT_CAPACITY = 500
@@ -143,27 +136,6 @@ export const useCodeUndoRedoStore = create<CodeUndoRedoState>()(
143136 const { [ key ] : _ , ...rest } = state . stacks
144137 set ( { stacks : rest } )
145138 } ,
146- clearRedo : ( workflowId , blockId , subBlockId ) => {
147- const key = getStackKey ( workflowId , blockId , subBlockId )
148- const state = get ( )
149- const stack = state . stacks [ key ]
150- if ( ! stack ) return
151- set ( {
152- stacks : {
153- ...state . stacks ,
154- [ key ] : { ...stack , redo : [ ] , lastUpdated : Date . now ( ) } ,
155- } ,
156- } )
157- } ,
158- getStackSizes : ( workflowId , blockId , subBlockId ) => {
159- const key = getStackKey ( workflowId , blockId , subBlockId )
160- const stack = get ( ) . stacks [ key ]
161- if ( ! stack ) return { undoSize : 0 , redoSize : 0 }
162- return { undoSize : stack . undo . length , redoSize : stack . redo . length }
163- } ,
164- reset : ( ) => {
165- set ( initialState )
166- } ,
167139 } ) ,
168140 {
169141 name : 'code-undo-redo-store' ,
0 commit comments