Merge 86411dccb38aab5e5409be0a062290d69e0b28d8 into 6b4c24c2e55b5b4013277bd799525086f6a0c40f

This commit is contained in:
w-sss 2026-03-21 12:42:22 +08:00 committed by GitHub
commit 14dae94467
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 1 deletions

View File

@ -25,12 +25,18 @@ export async function handleWhatsAppLogout(host: OpenClawApp) {
}
export async function handleChannelConfigSave(host: OpenClawApp) {
host.channelsError = null;
await saveConfig(host);
const saveError = host.lastError;
await loadConfig(host);
await loadChannels(host, true);
if (saveError) {
host.channelsError = saveError;
}
}
export async function handleChannelConfigReload(host: OpenClawApp) {
host.channelsError = null;
await loadConfig(host);
await loadChannels(host, true);
}

View File

@ -1,4 +1,4 @@
import { html } from "lit";
import { html, nothing } from "lit";
import type { ConfigUiHints } from "../types.ts";
import { formatChannelExtraValue, resolveChannelConfigValue } from "./channel-config-extras.ts";
import type { ChannelsProps } from "./channels.types.ts";
@ -118,6 +118,7 @@ export function renderChannelConfigForm(props: ChannelConfigFormProps) {
export function renderChannelConfigSection(params: { channelId: string; props: ChannelsProps }) {
const { channelId, props } = params;
const disabled = props.configSaving || props.configSchemaLoading;
const hasError = Boolean(props.lastError);
return html`
<div style="margin-top: 16px;">
${
@ -134,6 +135,15 @@ export function renderChannelConfigSection(params: { channelId: string; props: C
onPatch: props.onConfigPatch,
})
}
${
hasError
? html`
<div class="callout danger" style="margin-top: 12px;">
${props.lastError}
</div>
`
: nothing
}
<div class="row" style="margin-top: 12px;">
<button
class="btn primary"