Skip to content

Commit c738a71

Browse files
committed
ack comments
1 parent 80ede82 commit c738a71

File tree

1 file changed

+15
-6
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]

1 file changed

+15
-6
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -691,8 +691,11 @@ const WorkflowContent = React.memo(() => {
691691
return
692692
}
693693

694-
// Set pending selection before adding blocks - sync effect will apply it
695-
pendingSelectionRef.current = new Set(pastedBlocksArray.map((b) => b.id))
694+
// Set pending selection before adding blocks - sync effect will apply it (accumulates for rapid pastes)
695+
pendingSelectionRef.current = new Set([
696+
...(pendingSelectionRef.current ?? []),
697+
...pastedBlocksArray.map((b) => b.id),
698+
])
696699

697700
collaborativeBatchAddBlocks(
698701
pastedBlocksArray,
@@ -737,8 +740,11 @@ const WorkflowContent = React.memo(() => {
737740
return
738741
}
739742

740-
// Set pending selection before adding blocks - sync effect will apply it
741-
pendingSelectionRef.current = new Set(pastedBlocksArray.map((b) => b.id))
743+
// Set pending selection before adding blocks - sync effect will apply it (accumulates for rapid pastes)
744+
pendingSelectionRef.current = new Set([
745+
...(pendingSelectionRef.current ?? []),
746+
...pastedBlocksArray.map((b) => b.id),
747+
])
742748

743749
collaborativeBatchAddBlocks(
744750
pastedBlocksArray,
@@ -880,8 +886,11 @@ const WorkflowContent = React.memo(() => {
880886
return
881887
}
882888

883-
// Set pending selection before adding blocks - sync effect will apply it
884-
pendingSelectionRef.current = new Set(pastedBlocks.map((b) => b.id))
889+
// Set pending selection before adding blocks - sync effect will apply it (accumulates for rapid pastes)
890+
pendingSelectionRef.current = new Set([
891+
...(pendingSelectionRef.current ?? []),
892+
...pastedBlocks.map((b) => b.id),
893+
])
885894

886895
collaborativeBatchAddBlocks(
887896
pastedBlocks,

0 commit comments

Comments
 (0)