fix(ui): preserve config save error after loadChannels refresh

- Store save error before calling loadChannels
- Apply error after refresh completes
- Prevents loadChannels from clearing the error prematurely
- Fixes Codex P1: save error now persists for user to see
This commit is contained in:
w-sss 2026-03-17 23:15:52 +08:00
parent 21530f8645
commit 86411dccb3

View File

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