-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrote initial loading to async/await, added new Error page:
- I got rid of the nested promise callbacks, now it's all in one try/catch - A new error page is added. It's (hopefully) nice and clean. It also features a reload button that will attempt to reset the application's state by redirecting to '/'. Should this not work, there are more things to try out (parsing the documnent.location and removing searchParams manually).
- Loading branch information
Showing
4 changed files
with
145 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from "react"; | ||
import { Alert, AlertTitle, Box, Button } from "@mui/material"; | ||
|
||
export default function Error({ | ||
loadErrorMessage, | ||
loadErrorTitle, | ||
loadErrorReloadButtonText, | ||
}) { | ||
return ( | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
p: 10, | ||
justifyContent: "center", | ||
alignItems: "center", | ||
flexDirection: "column", | ||
minHeight: "100vh", | ||
}} | ||
> | ||
<Alert severity="error"> | ||
<AlertTitle>{loadErrorTitle}</AlertTitle> | ||
{loadErrorMessage} | ||
</Alert> | ||
<Button href="/" variant="contained" sx={{ mt: 3 }}> | ||
{loadErrorReloadButtonText} | ||
</Button> | ||
</Box> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters