diff --git a/src/components/ui/ErrorBoundary.jsx b/src/components/ui/ErrorBoundary.jsx index e286456..d8a8f96 100644 --- a/src/components/ui/ErrorBoundary.jsx +++ b/src/components/ui/ErrorBoundary.jsx @@ -4,6 +4,7 @@ export class ErrorBoundary extends Component { constructor(props) { super(props); this.state = { hasError: false, error: null }; + this.resetError = this.resetError.bind(this); } static getDerivedStateFromError(error) { @@ -14,6 +15,10 @@ export class ErrorBoundary extends Component { console.error("ErrorBoundary caught an error:", error, errorInfo); } + resetError() { + this.setState({ hasError: false, error: null }); + } + render() { if (this.state.hasError) { return ( @@ -39,12 +44,20 @@ export class ErrorBoundary extends Component {
The application encountered an unexpected error. Don't worry, your data is safe.
- +