Separated specification and implementation in TopErrorBoundary (#1031)
* Encapsulate SceneHistory. A little. * Clean up TopErrorBoundary
This commit is contained in:
parent
f6b36519f1
commit
1e8cd2bd1c
@ -20,6 +20,10 @@ export class TopErrorBoundary extends React.Component<
|
|||||||
localStorage: "",
|
localStorage: "",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return this.state.hasError ? this.errorSplash() : this.props.children;
|
||||||
|
}
|
||||||
|
|
||||||
componentDidCatch(error: Error) {
|
componentDidCatch(error: Error) {
|
||||||
resetCursor();
|
resetCursor();
|
||||||
const _localStorage: any = {};
|
const _localStorage: any = {};
|
||||||
@ -88,8 +92,7 @@ export class TopErrorBoundary extends React.Component<
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
private errorSplash() {
|
||||||
if (this.state.hasError) {
|
|
||||||
return (
|
return (
|
||||||
<div className="ErrorSplash">
|
<div className="ErrorSplash">
|
||||||
<div className="ErrorSplash-messageContainer">
|
<div className="ErrorSplash-messageContainer">
|
||||||
@ -155,7 +158,4 @@ export class TopErrorBoundary extends React.Component<
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.props.children;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user