diff --git a/web/frontend/src/components/channels/channel-config-page.tsx b/web/frontend/src/components/channels/channel-config-page.tsx index 6af821ac9..45c32d83f 100644 --- a/web/frontend/src/components/channels/channel-config-page.tsx +++ b/web/frontend/src/components/channels/channel-config-page.tsx @@ -95,16 +95,18 @@ function buildSavePayload( if (key.startsWith("_")) continue if (key === "enabled") continue - if (key in SECRET_FIELD_MAP) { - const editKey = SECRET_FIELD_MAP[key] - const incoming = asString(editConfig[editKey]) - payload[key] = incoming !== "" ? incoming : value - continue - } - payload[key] = value } + for (const [key, editKey] of Object.entries(SECRET_FIELD_MAP)) { + if (editKey in editConfig) { + const incoming = asString(editConfig[editKey]) + if (incoming !== "") { + payload[key] = incoming + } + } + } + if (channel.name === "whatsapp_native") { payload.use_native = true }