From e69e4b388478c23e14c93951b96e3b5dc3a8acfc Mon Sep 17 00:00:00 2001 From: Goon Date: Sun, 31 May 2026 16:26:11 +0700 Subject: [PATCH] fix(channels): preserve inherited quick ack mode --- .../pages/channels/channel-instance-form-dialog.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ui/web/src/pages/channels/channel-instance-form-dialog.tsx b/ui/web/src/pages/channels/channel-instance-form-dialog.tsx index 50070318..104d5c1a 100644 --- a/ui/web/src/pages/channels/channel-instance-form-dialog.tsx +++ b/ui/web/src/pages/channels/channel-instance-form-dialog.tsx @@ -134,7 +134,12 @@ export function ChannelInstanceFormDialog({ setConfigValues((prev) => ({ ...prev, [key]: value })); }, []); - const coerceBoolSelects = (cfg: Record, schema: FieldDef[]) => { + const coerceSelects = (cfg: Record, schema: FieldDef[]) => { + const selectKeys = new Set(schema.filter((f) => f.type === "select").map((f) => f.key)); + for (const key of selectKeys) { + if (cfg[key] === "inherit") delete cfg[key]; + } + const boolSelectKeys = new Set( schema.filter((f) => f.type === "select" && f.options?.some((o) => o.value === "true")).map((f) => f.key), ); @@ -159,7 +164,7 @@ export function ChannelInstanceFormDialog({ const cleanConfig = Object.fromEntries( Object.entries(configValues).filter(([, v]) => v !== undefined && v !== "" && v !== null), ); - coerceBoolSelects(cleanConfig, configSchema[values.channelType] ?? []); + coerceSelects(cleanConfig, configSchema[values.channelType] ?? []); // Drop the legacy bitrix24 public_url field if it leaked from an older // channel row's config — gateway now derives the URL from the portal's @@ -244,7 +249,7 @@ export function ChannelInstanceFormDialog({ const cleanConfig = Object.fromEntries( Object.entries(configValues).filter(([, v]) => v !== undefined && v !== "" && v !== null), ); - coerceBoolSelects(cleanConfig, configSchema[channelType] ?? []); + coerceSelects(cleanConfig, configSchema[channelType] ?? []); setLoading(true); setError(""); try {