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: "",
|
||||
};
|
||||
|
||||
render() {
|
||||
return this.state.hasError ? this.errorSplash() : this.props.children;
|
||||
}
|
||||
|
||||
componentDidCatch(error: Error) {
|
||||
resetCursor();
|
||||
const _localStorage: any = {};
|
||||
@ -88,8 +92,7 @@ export class TopErrorBoundary extends React.Component<
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.state.hasError) {
|
||||
private errorSplash() {
|
||||
return (
|
||||
<div className="ErrorSplash">
|
||||
<div className="ErrorSplash-messageContainer">
|
||||
@ -155,7 +158,4 @@ export class TopErrorBoundary extends React.Component<
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return this.props.children;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user