Skip to content

Commit 8122b87

Browse files
committed
update
1 parent 8436c73 commit 8122b87

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/w/components/preview/components/preview-editor

apps/sim/app/workspace/[workspaceId]/w/components/preview/components/preview-editor/preview-editor.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import { PreviewContextMenu } from '@/app/workspace/[workspaceId]/w/components/p
4444
import { PreviewWorkflow } from '@/app/workspace/[workspaceId]/w/components/preview/components/preview-workflow'
4545
import { useContextMenu } from '@/app/workspace/[workspaceId]/w/components/sidebar/hooks'
4646
import { getBlock } from '@/blocks'
47-
import type { BlockConfig, BlockIcon, SubBlockConfig } from '@/blocks/types'
47+
import type { BlockConfig, BlockIcon, SubBlockConfig, SubBlockType } from '@/blocks/types'
4848
import { normalizeName } from '@/executor/constants'
4949
import { navigatePath } from '@/executor/variables/resolvers/reference'
5050
import { useWorkflowState } from '@/hooks/queries/workflows'
@@ -1147,14 +1147,11 @@ function PreviewEditorContent({
11471147
const visibleSubBlocks = blockConfig.subBlocks.filter((subBlock) => {
11481148
if (subBlock.hidden || subBlock.hideFromPreview) return false
11491149

1150-
if (effectiveTrigger) {
1151-
const isValidTriggerSubblock = isPureTriggerBlock
1152-
? subBlock.mode === 'trigger' || !subBlock.mode
1153-
: subBlock.mode === 'trigger'
1154-
if (!isValidTriggerSubblock) return false
1155-
} else {
1156-
if (subBlock.mode === 'trigger' && blockConfig.category !== 'triggers') return false
1150+
if (subBlock.type === ('trigger-config' as SubBlockType)) {
1151+
return effectiveTrigger || isPureTriggerBlock
11571152
}
1153+
if (subBlock.mode === 'trigger' && !effectiveTrigger) return false
1154+
if (effectiveTrigger && subBlock.mode !== 'trigger') return false
11581155
if (!isSubBlockFeatureEnabled(subBlock)) return false
11591156
if (
11601157
!isSubBlockVisibleForMode(

0 commit comments

Comments
 (0)