Add error state for remote fetch page

This commit is contained in:
SleeplessOne1917 2023-07-21 20:27:47 -04:00
parent 792c0e63a9
commit b88de28f2e

View file

@ -95,6 +95,7 @@ export class RemoteFetch extends Component<any, RemoteFetchState> {
const status = "loading" as "success" | "loading" | "empty"; const status = "loading" as "success" | "loading" | "empty";
const { uri } = getRemoteFetchQueryParams(); const { uri } = getRemoteFetchQueryParams();
const remoteCommunityName = uri ? uriToQuery(uri) : "remote community";
switch (status) { switch (status) {
case "success": { case "success": {
@ -112,7 +113,7 @@ export class RemoteFetch extends Component<any, RemoteFetchState> {
return ( return (
<> <>
<h1> <h1>
Fetching {uri ? uriToQuery(uri) : "remote community"} Fetching {remoteCommunityName}
<LoadingEllipses /> <LoadingEllipses />
</h1> </h1>
<h5> <h5>
@ -121,6 +122,14 @@ export class RemoteFetch extends Component<any, RemoteFetchState> {
</> </>
); );
} }
default: {
return (
<>
<h1>Could not fetch {remoteCommunityName}</h1>
</>
);
}
} }
} }