ui: improve account error display

This commit is contained in:
Brad Stein 2026-01-02 20:20:57 -03:00
parent cd39e77d0c
commit dbaed208d0

View File

@ -246,7 +246,10 @@ async function refreshOverview() {
headers: { Accept: "application/json" },
cache: "no-store",
});
if (!resp.ok) throw new Error(`status ${resp.status}`);
if (!resp.ok) {
const data = await resp.json().catch(() => ({}));
throw new Error(data?.error || `status ${resp.status}`);
}
const data = await resp.json();
mailu.status = data.mailu?.status || "ready";
mailu.username = data.mailu?.username || auth.email || auth.username;
@ -260,8 +263,9 @@ async function refreshOverview() {
jellyfin.status = "unavailable";
jellyfin.syncStatus = "";
jellyfin.syncDetail = "";
mailu.error = "Failed to load account status.";
jellyfin.error = "Failed to load account status.";
const message = err?.message ? `Failed to load account status (${err.message})` : "Failed to load account status.";
mailu.error = message;
jellyfin.error = message;
}
}
@ -417,7 +421,7 @@ async function copy(key, text) {
flex-wrap: wrap;
align-items: center;
justify-content: flex-end;
gap: 10px;
gap: 14px;
}
.eyebrow {