diff --git a/src/components/TopErrorBoundary.tsx b/src/components/TopErrorBoundary.tsx index fcbc40e6..fbe38fc9 100644 --- a/src/components/TopErrorBoundary.tsx +++ b/src/components/TopErrorBoundary.tsx @@ -20,6 +20,10 @@ export class TopErrorBoundary extends React.Component< localStorage: "", }; + render() { + return this.state.hasError ? this.errorSplash() : this.props.children; + } + componentDidCatch(error: Error) { resetCursor(); const _localStorage: any = {}; @@ -88,74 +92,70 @@ export class TopErrorBoundary extends React.Component< ); } - render() { - if (this.state.hasError) { - return ( -
-
-
- {t("errorSplash.headingMain_pre")} - + private errorSplash() { + return ( +
+
+
+ {t("errorSplash.headingMain_pre")} + +
+
+ {t("errorSplash.clearCanvasMessage")} + +
+
+ + ⚠️ + + {t("errorSplash.clearCanvasCaveat")} +
-
- {t("errorSplash.clearCanvasMessage")} -
+
+
+ {t("errorSplash.openIssueMessage_pre")} + -
-
- - ⚠️ - - {t("errorSplash.clearCanvasCaveat")} - -
+ {t("errorSplash.openIssueMessage_post")}
-
-
- {t("errorSplash.openIssueMessage_pre")} - - {t("errorSplash.openIssueMessage_post")} -
-
-
- -