From 6694143d37e3335d65c12591891a63a3344d8b49 Mon Sep 17 00:00:00 2001 From: w-sss <1598099293@qq.com> Date: Tue, 17 Mar 2026 23:02:44 +0800 Subject: [PATCH] Revert "fix(ui): use dedicated configSaveError state instead of global lastError" This reverts commit 445328622cbf2ad35429e40be7e06f2b0658c96a. --- ui/src/ui/app-channels.ts | 5 ----- ui/src/ui/app-render.ts | 2 +- ui/src/ui/app-view-state.ts | 1 - ui/src/ui/app.ts | 1 - ui/src/ui/controllers/channels.types.ts | 1 - 5 files changed, 1 insertion(+), 9 deletions(-) diff --git a/ui/src/ui/app-channels.ts b/ui/src/ui/app-channels.ts index ff9aa5787fc..eb05e83e81b 100644 --- a/ui/src/ui/app-channels.ts +++ b/ui/src/ui/app-channels.ts @@ -25,17 +25,12 @@ export async function handleWhatsAppLogout(host: OpenClawApp) { } export async function handleChannelConfigSave(host: OpenClawApp) { - host.configSaveError = null; await saveConfig(host); - if (host.lastError) { - host.configSaveError = host.lastError; - } await loadConfig(host); await loadChannels(host, true); } export async function handleChannelConfigReload(host: OpenClawApp) { - host.configSaveError = null; await loadConfig(host); await loadChannels(host, true); } diff --git a/ui/src/ui/app-render.ts b/ui/src/ui/app-render.ts index 540e65b0342..786a85b0757 100644 --- a/ui/src/ui/app-render.ts +++ b/ui/src/ui/app-render.ts @@ -680,7 +680,7 @@ export function renderApp(state: AppViewState) { configUiHints: state.configUiHints, configSaving: state.configSaving, configFormDirty: state.configFormDirty, - configSaveError: state.configSaveError, + configSaveError: state.lastError, nostrProfileFormState: state.nostrProfileFormState, nostrProfileAccountId: state.nostrProfileAccountId, onRefresh: (probe) => loadChannels(state, probe), diff --git a/ui/src/ui/app-view-state.ts b/ui/src/ui/app-view-state.ts index 75459ca5cbf..375faa43137 100644 --- a/ui/src/ui/app-view-state.ts +++ b/ui/src/ui/app-view-state.ts @@ -145,7 +145,6 @@ export type AppViewState = { channelsSnapshot: ChannelsStatusSnapshot | null; channelsError: string | null; channelsLastSuccess: number | null; - configSaveError: string | null; whatsappLoginMessage: string | null; whatsappLoginQrDataUrl: string | null; whatsappLoginConnected: boolean | null; diff --git a/ui/src/ui/app.ts b/ui/src/ui/app.ts index 2c85ce883c9..af0d0cb9c96 100644 --- a/ui/src/ui/app.ts +++ b/ui/src/ui/app.ts @@ -240,7 +240,6 @@ export class OpenClawApp extends LitElement { @state() channelsSnapshot: ChannelsStatusSnapshot | null = null; @state() channelsError: string | null = null; @state() channelsLastSuccess: number | null = null; - @state() configSaveError: string | null = null; @state() whatsappLoginMessage: string | null = null; @state() whatsappLoginQrDataUrl: string | null = null; @state() whatsappLoginConnected: boolean | null = null; diff --git a/ui/src/ui/controllers/channels.types.ts b/ui/src/ui/controllers/channels.types.ts index f30a674ca2e..4fb8e6bc510 100644 --- a/ui/src/ui/controllers/channels.types.ts +++ b/ui/src/ui/controllers/channels.types.ts @@ -12,5 +12,4 @@ export type ChannelsState = { whatsappLoginQrDataUrl: string | null; whatsappLoginConnected: boolean | null; whatsappBusy: boolean; - configSaveError: string | null; };