fix- adding the useWebhookUrl check becfore calling loadWebhookOrGenerateUrl function:

This commit is contained in:
priyanshu.solanki
2025-12-18 12:20:13 -07:00
parent 6c10f31a40
commit f81c0ba9bf
2 changed files with 6 additions and 3 deletions

View File

@@ -85,11 +85,11 @@ export function ShortInput({
const persistSubBlockValueRef = useRef<(value: string) => void>(() => {})
const justPastedRef = useRef(false)
const webhookManagement = useWebhookManagement({
blockId,
triggerId: undefined,
isPreview,
useWebhookUrl,
})
const wandHook = useWand({

View File

@@ -14,6 +14,7 @@ interface UseWebhookManagementProps {
blockId: string
triggerId?: string
isPreview?: boolean
useWebhookUrl?: boolean
}
interface WebhookManagementState {
@@ -90,6 +91,7 @@ export function useWebhookManagement({
blockId,
triggerId,
isPreview = false,
useWebhookUrl = false,
}: UseWebhookManagementProps): WebhookManagementState {
const params = useParams()
const workflowId = params.workflowId as string
@@ -134,7 +136,6 @@ export function useWebhookManagement({
const currentlyLoading = store.loadingWebhooks.has(blockId)
const alreadyChecked = store.checkedWebhooks.has(blockId)
const currentWebhookId = store.getValue(blockId, 'webhookId')
if (currentlyLoading || (alreadyChecked && currentWebhookId)) {
return
}
@@ -205,7 +206,9 @@ export function useWebhookManagement({
}
}
loadWebhookOrGenerateUrl()
if (useWebhookUrl) {
loadWebhookOrGenerateUrl()
}
}, [isPreview, triggerId, workflowId, blockId])
const createWebhook = async (