v3: error cards across the app, friendly network errors, code quality pass
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user