mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-23 12:51:13 +00:00
Add error state for remote fetch page
This commit is contained in:
parent
792c0e63a9
commit
b88de28f2e
1 changed files with 10 additions and 1 deletions
|
@ -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>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue