Skip to content

Commit 28b4c4c

Browse files
authored
fix(blocks): resolve variable display in mothership resource preview (#4226)
* fix(blocks): resolve variable display in mothership resource preview Variables block showed empty assignments in the embedded workflow preview because currentWorkflowId was read from URL params, which don't contain workflowId in the mothership route. Fall back to activeWorkflowId from the workflow registry. * fix(blocks): narrow currentWorkflowId to string to satisfy strict null checks
1 parent 32541e7 commit 28b4c4c

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -862,8 +862,6 @@ export const WorkflowBlock = memo(function WorkflowBlock({
862862
const contentRef = useRef<HTMLDivElement>(null)
863863

864864
const params = useParams()
865-
// In sandbox mode pass empty strings so all workspace-scoped queries are disabled
866-
const currentWorkflowId = isSandbox ? '' : (params.workflowId as string)
867865
const workspaceId = isSandbox ? '' : (params.workspaceId as string)
868866

869867
const {
@@ -877,6 +875,8 @@ export const WorkflowBlock = memo(function WorkflowBlock({
877875
runPathStatus,
878876
} = useBlockVisual({ blockId: id, data, isPending, isSelected: selected })
879877

878+
const currentWorkflowId = isSandbox ? '' : (params.workflowId as string) || activeWorkflowId || ''
879+
880880
const currentBlock = currentWorkflow.getBlockById(id)
881881

882882
const { horizontalHandles, blockHeight, blockWidth, displayAdvancedMode, displayTriggerMode } =

0 commit comments

Comments
 (0)