File tree Expand file tree Collapse file tree
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/search-replace Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -383,6 +383,7 @@ export function WorkflowSearchReplace() {
383383 prevQueryRef . current = query
384384
385385 if ( hydratedMatches . length === 0 ) {
386+ afterReplaceIndexRef . current = null
386387 if ( activeMatchId ) setActiveMatchId ( null )
387388 usePanelEditorSearchStore . getState ( ) . setActiveSearchTarget ( null )
388389 return
@@ -431,6 +432,7 @@ export function WorkflowSearchReplace() {
431432 const handleApply = ( matchIds : string [ ] ) => {
432433 if ( ! workflowId || isApplying || searchReadOnly ) return
433434 setIsApplying ( true )
435+ let committed = false
434436
435437 try {
436438 const selectedIds = new Set ( matchIds )
@@ -527,8 +529,10 @@ export function WorkflowSearchReplace() {
527529 message : `Replaced ${ replacedCount } field${ replacedCount === 1 ? '' : 's' } .` ,
528530 workflowId,
529531 } )
532+ committed = true
530533 } finally {
531534 setIsApplying ( false )
535+ if ( ! committed ) afterReplaceIndexRef . current = null
532536 }
533537 }
534538
You can’t perform that action at this time.
0 commit comments