Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export function ShortInput({
blockId,
triggerId: undefined,
isPreview,
useWebhookUrl,
})

const wandHook = useWand({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export function TriggerSave({
blockId,
triggerId: effectiveTriggerId,
isPreview,
useWebhookUrl: true, // to store the webhook url in the store
})

const triggerConfig = useSubBlockStore((state) => state.getValue(blockId, 'triggerConfig'))
Expand Down
9 changes: 6 additions & 3 deletions apps/sim/hooks/use-webhook-management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface UseWebhookManagementProps {
blockId: string
triggerId?: string
isPreview?: boolean
useWebhookUrl?: boolean
}

interface WebhookManagementState {
Expand Down Expand Up @@ -90,6 +91,7 @@ export function useWebhookManagement({
blockId,
triggerId,
isPreview = false,
useWebhookUrl = false,
}: UseWebhookManagementProps): WebhookManagementState {
const params = useParams()
const workflowId = params.workflowId as string
Expand Down Expand Up @@ -204,9 +206,10 @@ export function useWebhookManagement({
})
}
}

loadWebhookOrGenerateUrl()
}, [isPreview, triggerId, workflowId, blockId])
if (useWebhookUrl) {
loadWebhookOrGenerateUrl()
}
}, [isPreview, triggerId, workflowId, blockId, useWebhookUrl])

const createWebhook = async (
effectiveTriggerId: string | undefined,
Expand Down
Loading