From 276ce665e47fa7e3c3bcec7b9890884be39609a9 Mon Sep 17 00:00:00 2001 From: waleed Date: Tue, 27 Jan 2026 14:50:57 -0800 Subject: [PATCH] ack comments --- .../app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx index a7592a466..24365795b 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx @@ -321,7 +321,6 @@ const WorkflowContent = React.memo(() => { const isAutoConnectEnabled = useAutoConnect() const autoConnectRef = useRef(isAutoConnectEnabled) - // Keep ref in sync with latest value for use in callbacks (no effect needed) autoConnectRef.current = isAutoConnectEnabled // Panel open states for context menu @@ -463,10 +462,13 @@ const WorkflowContent = React.memo(() => { /** Re-applies diff markers when blocks change after socket rehydration. */ const diffBlocksRef = useRef(blocks) useEffect(() => { + if (!isWorkflowReady) return + const blocksChanged = blocks !== diffBlocksRef.current + if (!blocksChanged) return + diffBlocksRef.current = blocks - if (!isWorkflowReady || !blocksChanged) return if (hasActiveDiff && isDiffReady) { setTimeout(() => reapplyDiffMarkers(), 0) }