From e83afc0a62f16882f2f2636af4d4ad3d57ddc564 Mon Sep 17 00:00:00 2001 From: "priyanshu.solanki" Date: Thu, 18 Dec 2025 12:31:18 -0700 Subject: [PATCH 1/3] fixing the useWbehookManangement call to only call the loadwebhookorgenerateurl function when the useWebhookurl flag is true --- .../sub-block/components/short-input/short-input.tsx | 1 + .../sub-block/components/trigger-save/trigger-save.tsx | 1 + apps/sim/hooks/use-webhook-management.ts | 7 +++++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/short-input/short-input.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/short-input/short-input.tsx index 25d59184cc..3bca388f34 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/short-input/short-input.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/short-input/short-input.tsx @@ -90,6 +90,7 @@ export function ShortInput({ blockId, triggerId: undefined, isPreview, + useWebhookUrl, }) const wandHook = useWand({ diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/trigger-save/trigger-save.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/trigger-save/trigger-save.tsx index 3d29b1b921..ab9f43f080 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/trigger-save/trigger-save.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/trigger-save/trigger-save.tsx @@ -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')) diff --git a/apps/sim/hooks/use-webhook-management.ts b/apps/sim/hooks/use-webhook-management.ts index d29018c4e2..9ba645e7c3 100644 --- a/apps/sim/hooks/use-webhook-management.ts +++ b/apps/sim/hooks/use-webhook-management.ts @@ -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 @@ -204,8 +206,9 @@ export function useWebhookManagement({ }) } } - - loadWebhookOrGenerateUrl() + if (useWebhookUrl) { + loadWebhookOrGenerateUrl() + } }, [isPreview, triggerId, workflowId, blockId]) const createWebhook = async ( From 261aa3d72dd1e5939c3a824d9baae707f9686524 Mon Sep 17 00:00:00 2001 From: "priyanshu.solanki" Date: Thu, 18 Dec 2025 12:39:47 -0700 Subject: [PATCH 2/3] fixing a react component: --- apps/sim/hooks/use-webhook-management.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/sim/hooks/use-webhook-management.ts b/apps/sim/hooks/use-webhook-management.ts index 9ba645e7c3..5651c7f777 100644 --- a/apps/sim/hooks/use-webhook-management.ts +++ b/apps/sim/hooks/use-webhook-management.ts @@ -209,7 +209,7 @@ export function useWebhookManagement({ if (useWebhookUrl) { loadWebhookOrGenerateUrl() } - }, [isPreview, triggerId, workflowId, blockId]) + }, [isPreview, triggerId, workflowId, blockId,useWebhookUrl]) const createWebhook = async ( effectiveTriggerId: string | undefined, From fbde64f0b0e73a93f57ac9ccbf5e915aa043b432 Mon Sep 17 00:00:00 2001 From: "priyanshu.solanki" Date: Thu, 18 Dec 2025 13:04:25 -0700 Subject: [PATCH 3/3] fixing lint errors --- apps/sim/hooks/use-webhook-management.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/sim/hooks/use-webhook-management.ts b/apps/sim/hooks/use-webhook-management.ts index 5651c7f777..1fb777fe8c 100644 --- a/apps/sim/hooks/use-webhook-management.ts +++ b/apps/sim/hooks/use-webhook-management.ts @@ -209,7 +209,7 @@ export function useWebhookManagement({ if (useWebhookUrl) { loadWebhookOrGenerateUrl() } - }, [isPreview, triggerId, workflowId, blockId,useWebhookUrl]) + }, [isPreview, triggerId, workflowId, blockId, useWebhookUrl]) const createWebhook = async ( effectiveTriggerId: string | undefined,