From 25b6f470d5f74201a07ad099c0c831d3e36144c6 Mon Sep 17 00:00:00 2001 From: benya Date: Sun, 8 Mar 2026 20:34:36 +0300 Subject: [PATCH] fix(settings): show sessions load errors explicitly --- web/src/components/SettingsPanel.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/src/components/SettingsPanel.tsx b/web/src/components/SettingsPanel.tsx index 20f6c11..9b30d44 100644 --- a/web/src/components/SettingsPanel.tsx +++ b/web/src/components/SettingsPanel.tsx @@ -38,6 +38,7 @@ export function SettingsPanel({ open, onClose }: Props) { const [privacyPrivateMessages, setPrivacyPrivateMessages] = useState<"everyone" | "contacts" | "nobody">("everyone"); const [sessions, setSessions] = useState([]); const [sessionsLoading, setSessionsLoading] = useState(false); + const [sessionsError, setSessionsError] = useState(null); const [revokeAllLoading, setRevokeAllLoading] = useState(false); const [revokingSessionIds, setRevokingSessionIds] = useState([]); const [twofaCode, setTwofaCode] = useState(""); @@ -185,6 +186,7 @@ export function SettingsPanel({ open, onClose }: Props) { } let cancelled = false; setSessionsLoading(true); + setSessionsError(null); void (async () => { try { const rows = await listSessions(); @@ -194,6 +196,7 @@ export function SettingsPanel({ open, onClose }: Props) { } catch { if (!cancelled) { setSessions([]); + setSessionsError("Failed to load sessions"); } } finally { if (!cancelled) { @@ -697,6 +700,7 @@ export function SettingsPanel({ open, onClose }: Props) { {sessionsLoading ?

Loading sessions...

: null} + {!sessionsLoading && sessionsError ?

{sessionsError}

: null} {!sessionsLoading && sessions.length === 0 ?

No active sessions

: null}
{sessions.map((session) => (