Add a error page when ui is crashed

pull/1311/head^2
LASER-Yi 4 years ago
parent 6ef7795ac5
commit 04fd39bc8a

@ -1,3 +1,4 @@
import { faSadCry as fasSadCry } from "@fortawesome/free-regular-svg-icons";
import { faExclamationTriangle } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import React, {
@ -64,7 +65,7 @@ const App: FunctionComponent<Props> = () => {
} else if (typeof initialized === "string") {
return <InitializationErrorView>{initialized}</InitializationErrorView>;
}
try {
return (
<SidebarToggleContext.Provider value={toggleSidebar}>
<Row noGutters className="header-container">
@ -79,6 +80,24 @@ const App: FunctionComponent<Props> = () => {
<NotificationContainer></NotificationContainer>
</SidebarToggleContext.Provider>
);
} catch (error) {
// TODO: Extract me!
return (
<Container className="d-flex flex-column align-items-center my-5">
<h1>
<FontAwesomeIcon className="mr-2" icon={fasSadCry}></FontAwesomeIcon>
Ouch! UI is crashed!
</h1>
<Button
href="https://github.com/morpheus65535/bazarr/issues/new/choose"
target="_blank"
variant="light"
>
Report Issue
</Button>
</Container>
);
}
};
const InitializationErrorView: FunctionComponent<{

Loading…
Cancel
Save