ui: improve account error display
This commit is contained in:
parent
cd39e77d0c
commit
dbaed208d0
@ -246,7 +246,10 @@ async function refreshOverview() {
|
|||||||
headers: { Accept: "application/json" },
|
headers: { Accept: "application/json" },
|
||||||
cache: "no-store",
|
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();
|
const data = await resp.json();
|
||||||
mailu.status = data.mailu?.status || "ready";
|
mailu.status = data.mailu?.status || "ready";
|
||||||
mailu.username = data.mailu?.username || auth.email || auth.username;
|
mailu.username = data.mailu?.username || auth.email || auth.username;
|
||||||
@ -260,8 +263,9 @@ async function refreshOverview() {
|
|||||||
jellyfin.status = "unavailable";
|
jellyfin.status = "unavailable";
|
||||||
jellyfin.syncStatus = "";
|
jellyfin.syncStatus = "";
|
||||||
jellyfin.syncDetail = "";
|
jellyfin.syncDetail = "";
|
||||||
mailu.error = "Failed to load account status.";
|
const message = err?.message ? `Failed to load account status (${err.message})` : "Failed to load account status.";
|
||||||
jellyfin.error = "Failed to load account status.";
|
mailu.error = message;
|
||||||
|
jellyfin.error = message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -417,7 +421,7 @@ async function copy(key, text) {
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
gap: 10px;
|
gap: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.eyebrow {
|
.eyebrow {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user