Skip to content

Commit 40de1d3

Browse files
committed
fix
1 parent 876db6c commit 40de1d3

File tree

1 file changed

+5
-2
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2165,8 +2165,11 @@ const WorkflowContent = React.memo(() => {
21652165
})
21662166
const selectedIds = selectedIdsRef.current as string[] | null
21672167
if (selectedIds !== null) {
2168-
const { currentBlockId, clearCurrentBlock } = usePanelEditorStore.getState()
2169-
if (currentBlockId && selectedIds.indexOf(currentBlockId) === -1) {
2168+
const { currentBlockId, clearCurrentBlock, setCurrentBlockId } =
2169+
usePanelEditorStore.getState()
2170+
if (selectedIds.length === 1 && selectedIds[0] !== currentBlockId) {
2171+
setCurrentBlockId(selectedIds[0])
2172+
} else if (selectedIds.length === 0 && currentBlockId) {
21702173
clearCurrentBlock()
21712174
}
21722175
}

0 commit comments

Comments
 (0)