MCPcopy Index your code
hub / github.com/simstudioai/sim / resolveSelectedObjectType

Function resolveSelectedObjectType

apps/sim/triggers/hubspot/poller.ts:23–34  ·  view source on GitHub ↗

* Resolves the effective object type from the subblock store. `getValue` returns `null` * for fields the user hasn't interacted with yet, so we fall back to the dropdown's * default ('contact') — otherwise the cascading property selectors render empty on * first render even when the dropdown visi

(blockId: string)

Source from the content-addressed store, hash-verified

21 * first render even when the dropdown visibly shows "contact".
22 */
23function resolveSelectedObjectType(blockId: string): string | null {
24 const objectType = useSubBlockStore.getState().getValue(blockId, 'objectType') as string | null
25 const customId = useSubBlockStore.getState().getValue(blockId, 'customObjectTypeId') as
26 | string
27 | null
28 const selected = objectType ?? 'contact'
29 if (selected === 'custom') {
30 const trimmed = customId?.trim()
31 return trimmed ? trimmed : null
32 }
33 return selected
34}
35
36async function fetchHubSpotProperties(blockId: string, objectType: string) {
37 const credentialId = useSubBlockStore.getState().getValue(blockId, 'triggerCredentials') as

Callers 1

poller.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected