v3: error cards across the app, friendly network errors, code quality pass

This commit is contained in:
khannurien
2026-03-21 19:17:23 +00:00
parent 608c6bc6a8
commit 5bed03baa5
21 changed files with 206 additions and 121 deletions

View File

@@ -8,6 +8,7 @@ import {
import { Link, useParams } from "react-router";
import { API_URL } from "../config/api.ts";
import { friendlyFetchError } from "../utils/apiError.ts";
import type { Dump, PaginatedData, PublicUser, RawDump } from "../model.ts";
import { deserializeDump, deserializePublicUser } from "../model.ts";
import { useAuth } from "../hooks/useAuth.ts";
@@ -83,7 +84,7 @@ export function UserUpvoted() {
.catch((err) =>
setState({
status: "error",
error: err instanceof Error ? err.message : "Failed to load",
error: friendlyFetchError(err),
})
);
return;
@@ -121,7 +122,7 @@ export function UserUpvoted() {
.catch((err) =>
setState({
status: "error",
error: err instanceof Error ? err.message : "Failed to load",
error: friendlyFetchError(err),
})
);
}, [username]);