Add sloth emoji to section labels, friendlier network error
- Add sloth emoji prefix to "Downloaded" and "Recommended" section
labels in the Hub model picker so they are visually distinct.
- Replace browser network errors ("NetworkError when attempting to
fetch resource" / "Failed to fetch") with a clearer message:
"Studio isn't running -- please relaunch it."
This commit is contained in:
parent
a45babc620
commit
2642f6d21d
2 changed files with 11 additions and 3 deletions
|
|
@ -495,7 +495,7 @@ export function HubModelPicker({
|
|||
<div className="p-1">
|
||||
{!showHfSection && (cachedGguf.length > 0 || cachedModels.length > 0) ? (
|
||||
<>
|
||||
<ListLabel>Downloaded</ListLabel>
|
||||
<ListLabel>{"\uD83E\uDDA5"} Downloaded</ListLabel>
|
||||
{cachedGguf.map((c) => (
|
||||
<div key={c.repo_id}>
|
||||
<ModelRow
|
||||
|
|
@ -525,7 +525,7 @@ export function HubModelPicker({
|
|||
|
||||
{!showHfSection ? (
|
||||
<>
|
||||
<ListLabel>Recommended</ListLabel>
|
||||
<ListLabel>{"\uD83E\uDDA5"} Recommended</ListLabel>
|
||||
{recommendedIds.length === 0 ? (
|
||||
<div className="px-2.5 py-2 text-xs text-muted-foreground">
|
||||
No default models.
|
||||
|
|
|
|||
|
|
@ -84,7 +84,15 @@ export async function authFetch(
|
|||
headers.set("Authorization", `Bearer ${accessToken}`);
|
||||
}
|
||||
|
||||
const response = await fetch(input, { ...init, headers });
|
||||
let response: Response;
|
||||
try {
|
||||
response = await fetch(input, { ...init, headers });
|
||||
} catch (err) {
|
||||
if (err instanceof TypeError) {
|
||||
throw new Error("Studio isn't running -- please relaunch it.");
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
if (await isPasswordChangeRequiredResponse(response)) {
|
||||
void redirectToAuth();
|
||||
return response;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue