Skip to content

Commit ba8addf

Browse files
committed
ack comments
1 parent fb2714a commit ba8addf

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

apps/sim/app/workspace/[workspaceId]/logs/components/log-details/components/execution-snapshot/execution-snapshot.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,15 @@ export function ExecutionSnapshot({
211211

212212
if (isModal) {
213213
return (
214-
<Modal open={isOpen} onOpenChange={(open) => !open && onClose()}>
214+
<Modal
215+
open={isOpen}
216+
onOpenChange={(open) => {
217+
if (!open) {
218+
setPinnedBlockId(null)
219+
onClose()
220+
}
221+
}}
222+
>
215223
<ModalContent size='full' className='flex h-[90vh] flex-col'>
216224
<ModalHeader>Workflow State</ModalHeader>
217225

apps/sim/app/workspace/[workspaceId]/w/components/preview/components/block-details-sidebar.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22

3-
import { useMemo, useState } from 'react'
3+
import { useEffect, useMemo, useState } from 'react'
44
import { ChevronDown as ChevronDownIcon, X } from 'lucide-react'
55
import { ReactFlowProvider } from 'reactflow'
66
import { Badge, Button, ChevronDown, Code } from '@/components/emcn'
@@ -210,10 +210,11 @@ function ExecutionDataSection({ title, data, isError = false }: ExecutionDataSec
210210
*/
211211
function ResolvedConnectionsSection({ connections }: { connections: ResolvedConnection[] }) {
212212
const [isCollapsed, setIsCollapsed] = useState(false)
213-
const [expandedBlocks, setExpandedBlocks] = useState<Set<string>>(() => {
214-
// Start with all blocks expanded
215-
return new Set(connections.map((c) => c.blockId))
216-
})
213+
const [expandedBlocks, setExpandedBlocks] = useState<Set<string>>(new Set())
214+
215+
useEffect(() => {
216+
setExpandedBlocks(new Set(connections.map((c) => c.blockId)))
217+
}, [connections])
217218

218219
if (connections.length === 0) return null
219220

0 commit comments

Comments
 (0)