fix: edit webhook time (#18549)
This commit is contained in:
1 parent
08e58851e7
commit
ea827ebbc6
2 files changed
+13
-11
No files matched your search
@@ -121,6 +121,14 @@ const WebhookForm = (props: {
|
||||
},
|
||||
});
|
||||
|
||||
const showTimeSection = formMethods
|
||||
.watch("eventTriggers")
|
||||
?.find(
|
||||
(trigger) =>
|
||||
trigger === WebhookTriggerEvents.AFTER_HOSTS_CAL_VIDEO_NO_SHOW ||
|
||||
trigger === WebhookTriggerEvents.AFTER_GUESTS_CAL_VIDEO_NO_SHOW
|
||||
);
|
||||
|
||||
const [useCustomTemplate, setUseCustomTemplate] = useState(
|
||||
props?.webhook?.payloadTemplate !== undefined && props?.webhook?.payloadTemplate !== null
|
||||
);
|
||||
@@ -128,14 +136,6 @@ const WebhookForm = (props: {
|
||||
const [changeSecret, setChangeSecret] = useState<boolean>(false);
|
||||
const hasSecretKey = !!props?.webhook?.secret;
|
||||
|
||||
const [showTimeSection, setShowTimeSection] = useState(
|
||||
!!triggerOptions.find(
|
||||
(trigger) =>
|
||||
trigger.value === WebhookTriggerEvents.AFTER_HOSTS_CAL_VIDEO_NO_SHOW ||
|
||||
trigger.value === WebhookTriggerEvents.AFTER_GUESTS_CAL_VIDEO_NO_SHOW
|
||||
)
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (changeSecret) {
|
||||
formMethods.unregister("secret", { keepDefaultValue: false });
|
||||
@@ -219,8 +219,6 @@ const WebhookForm = (props: {
|
||||
formMethods.setValue("time", undefined, { shouldDirty: true });
|
||||
formMethods.setValue("timeUnit", undefined, { shouldDirty: true });
|
||||
}
|
||||
|
||||
setShowTimeSection(noShowWebhookTriggerExists);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user