errorBoundary fix
This commit is contained in:
@@ -16,19 +16,20 @@ class ErrorBoundary extends Component {
|
||||
|
||||
componentDidCatch(error, errorInfo) {
|
||||
console.error("Uncaught error:", error, errorInfo);
|
||||
this.handleError();
|
||||
}
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
if (this.state.hasError) {
|
||||
clearLaunchParams();
|
||||
if (typeof window === "object") {
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
handleError = () => {
|
||||
clearLaunchParams();
|
||||
|
||||
if (typeof window === "object") {
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
if (this.state.hasError) {
|
||||
return <div>Something went wrong.</div>;
|
||||
return <div>Something went wrong. Reloading...</div>;
|
||||
}
|
||||
|
||||
return this.props.children;
|
||||
|
||||
Reference in New Issue
Block a user