From 4097a33c2dfc72bbda1e18f5495184191aaac5d8 Mon Sep 17 00:00:00 2001 From: Danielwangyy <32700482+Danielwangyy@users.noreply.github.com> Date: Sun, 5 Apr 2026 15:14:32 +0800 Subject: [PATCH] fix(viewer): show session-expired toast when loadConfig gets 401 loadConfig() silently returned on non-200 responses, leaving the settings form with empty/default values. Users saw blank model fields and "Provider and Model are required" errors on test, with no hint that the real issue was an expired session. Other settings functions (doSaveConfig, saveModelsConfig, testModel) already handle 401 correctly via `toast(t('settings.session.expired'))`. This commit applies the same pattern to loadConfig for consistency. Made-with: Cursor --- apps/memos-local-openclaw/src/viewer/html.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/memos-local-openclaw/src/viewer/html.ts b/apps/memos-local-openclaw/src/viewer/html.ts index 14aecc6fc..8491691cb 100644 --- a/apps/memos-local-openclaw/src/viewer/html.ts +++ b/apps/memos-local-openclaw/src/viewer/html.ts @@ -6685,6 +6685,7 @@ function onProviderChange(){} async function loadConfig(){ try{ const r=await fetch('/api/config'); + if(r.status===401){toast(t('settings.session.expired'),'error');return;} if(!r.ok) return; const cfg=await r.json(); const emb=cfg.embedding||{};