Revert "fix(ui): use dedicated configSaveError state instead of global lastError"

This reverts commit 445328622cbf2ad35429e40be7e06f2b0658c96a.
This commit is contained in:
w-sss 2026-03-17 23:02:44 +08:00
parent 445328622c
commit 6694143d37
5 changed files with 1 additions and 9 deletions

View File

@ -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);
}

View File

@ -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),

View File

@ -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;

View File

@ -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;

View File

@ -12,5 +12,4 @@ export type ChannelsState = {
whatsappLoginQrDataUrl: string | null;
whatsappLoginConnected: boolean | null;
whatsappBusy: boolean;
configSaveError: string | null;
};