Skip to content

Commit ab3e2bf

Browse files
committed
cleanup code
1 parent de006db commit ab3e2bf

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

apps/sim/lib/workflows/triggers.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ const START_CONFLICT_TYPES: TriggerType[] = [
6161

6262
type BlockWithType = { type: string; subBlocks?: Record<string, unknown> | undefined }
6363

64+
type BlockWithMetadata = BlockWithType & {
65+
category?: string
66+
triggers?: { enabled?: boolean }
67+
}
68+
6469
export interface StartBlockCandidate<T extends BlockWithType> {
6570
blockId: string
6671
block: T
@@ -101,8 +106,9 @@ export function classifyStartBlockType(
101106
}
102107

103108
export function classifyStartBlock<T extends BlockWithType>(block: T): StartBlockPath | null {
104-
const category = (block as any)?.category as string | undefined
105-
const triggerModeEnabled = Boolean((block as any)?.triggers?.enabled)
109+
const blockWithMetadata = block as BlockWithMetadata
110+
const category = blockWithMetadata.category
111+
const triggerModeEnabled = Boolean(blockWithMetadata.triggers?.enabled)
106112
return classifyStartBlockType(block.type, { category, triggerModeEnabled })
107113
}
108114

0 commit comments

Comments
 (0)