()
| 129 | ); |
| 130 | |
| 131 | async function handleSubmit() { |
| 132 | if (!selectedChannelId || !yamlDefinition.trim()) return; |
| 133 | |
| 134 | try { |
| 135 | const saved = await mutation.mutateAsync(yamlDefinition); |
| 136 | handleOpenChange(false); |
| 137 | if (saved.webhookSecret) { |
| 138 | const relayHttpUrl = await getRelayHttpUrl(); |
| 139 | setSavedWebhookInfo({ |
| 140 | relayHttpUrl, |
| 141 | webhookSecret: saved.webhookSecret, |
| 142 | workflowId: saved.workflow.id, |
| 143 | }); |
| 144 | } |
| 145 | } catch { |
| 146 | // React Query stores the error; keep the dialog open. |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | const showChannelSelector = mode !== "edit" && channels.length > 1; |
| 151 | const showChannelInfo = mode !== "edit" && channels.length === 1; |
no test coverage detected