From f7f36978e13628c6895daf534efcc225842427e5 Mon Sep 17 00:00:00 2001 From: Akash Jayan <101409608+Akashjayan1999@users.noreply.github.com> Date: Mon, 6 Jan 2025 17:07:23 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20initialize=20useCustomTemplate=20state?= =?UTF-8?q?=20based=20on=20payloadTemplate=20prop=E2=80=A6=20(#18257)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/features/webhooks/components/WebhookForm.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/features/webhooks/components/WebhookForm.tsx b/packages/features/webhooks/components/WebhookForm.tsx index b9f47aa344..59e066e597 100644 --- a/packages/features/webhooks/components/WebhookForm.tsx +++ b/packages/features/webhooks/components/WebhookForm.tsx @@ -121,7 +121,9 @@ const WebhookForm = (props: { }, }); - const [useCustomTemplate, setUseCustomTemplate] = useState(false); + const [useCustomTemplate, setUseCustomTemplate] = useState( + props?.webhook?.payloadTemplate !== undefined && props?.webhook?.payloadTemplate !== null + ); const [newSecret, setNewSecret] = useState(""); const [changeSecret, setChangeSecret] = useState(false); const hasSecretKey = !!props?.webhook?.secret;