diff --git a/src/core/i18n/default.json b/src/core/i18n/default.json index bbf7d39..f6a6889 100644 --- a/src/core/i18n/default.json +++ b/src/core/i18n/default.json @@ -74,7 +74,7 @@ "RETRY_RENDER": "Retry Render", "SAFE_MODE": "Safe Mode", "SAFE_MODE_NOTICE_PLUGINS": "You are in Safe Mode, so plugins cannot be loaded. Disable any misbehaving plugins, then return to Normal Mode from the General settings page.", - "SAFE_MODE_NOTICE_THEMES": "You are in Safe Mode, meaning themes have been temporarily disabled.{enabled, select, true { If a theme appears to be causing the issue, you can press below to disable it persistently.}}", + "SAFE_MODE_NOTICE_THEMES": "You are in Safe Mode, meaning themes have been temporarily disabled. {enabled, select, true {If a theme appears to be causing the issue, you can press below to disable it persistently.} false {}}", "SEARCH": "Search", "STACK_TRACE": "Stack Trace", "SUCCESSFULLY_INSTALLED": "Successfully installed", diff --git a/src/lib/ui/components/ErrorBoundary.tsx b/src/lib/ui/components/ErrorBoundary.tsx index e55a40c..debda61 100644 --- a/src/lib/ui/components/ErrorBoundary.tsx +++ b/src/lib/ui/components/ErrorBoundary.tsx @@ -6,10 +6,12 @@ import { FormText } from "@ui/components/discord/Forms"; import { createThemedStyleSheet } from "@ui/styles"; import { ScrollView } from "react-native"; -interface ErrorBoundaryState { - hasErr: boolean; - errText?: string; -} +type ErrorBoundaryState = { + hasErr: false; +} | { + hasErr: true; + error: Error; +}; export interface ErrorBoundaryProps { children: JSX.Element | JSX.Element[]; @@ -34,7 +36,7 @@ export default class ErrorBoundary extends React.Component ({ hasErr: true, errText: error.message }); + static getDerivedStateFromError = (error: Error) => ({ hasErr: true, error }); render() { if (!this.state.hasErr) return this.props.children; @@ -42,12 +44,16 @@ export default class ErrorBoundary extends React.Component {Strings.UH_OH} - {this.state.errText} + {this.state.error.name} + {this.state.error.message} + {this.state.error.stack && + {this.state.error.stack} + }