Skip to content
Snippets Groups Projects
Unverified Commit e6fe3d1e authored by Paul Kaplan's avatar Paul Kaplan Committed by GitHub
Browse files

Merge pull request #2145 from paulkaplan/fix-error-boundary

Move error boundary out beyond the project loader
parents 623b382b 9be70ca2
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ import VM from 'scratch-vm'; ...@@ -5,7 +5,7 @@ import VM from 'scratch-vm';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import ReactModal from 'react-modal'; import ReactModal from 'react-modal';
import ErrorBoundary from './error-boundary.jsx'; import ErrorBoundaryHOC from '../lib/error-boundary-hoc.jsx';
import {openExtensionLibrary} from '../reducers/modals'; import {openExtensionLibrary} from '../reducers/modals';
import { import {
activateTab, activateTab,
...@@ -75,15 +75,13 @@ class GUI extends React.Component { ...@@ -75,15 +75,13 @@ class GUI extends React.Component {
...componentProps ...componentProps
} = this.props; } = this.props;
return ( return (
<ErrorBoundary action="Top Level App"> <GUIComponent
<GUIComponent loading={fetchingProject || this.state.loading || loadingStateVisible}
loading={fetchingProject || this.state.loading || loadingStateVisible} vm={vm}
vm={vm} {...componentProps}
{...componentProps} >
> {children}
{children} </GUIComponent>
</GUIComponent>
</ErrorBoundary>
); );
} }
} }
...@@ -129,7 +127,9 @@ const ConnectedGUI = connect( ...@@ -129,7 +127,9 @@ const ConnectedGUI = connect(
mapDispatchToProps, mapDispatchToProps,
)(GUI); )(GUI);
const WrappedGui = ProjectLoaderHOC(vmListenerHOC(ConnectedGUI)); const WrappedGui = ErrorBoundaryHOC('Top Level App')(
ProjectLoaderHOC(vmListenerHOC(ConnectedGUI))
);
WrappedGui.setAppElement = ReactModal.setAppElement; WrappedGui.setAppElement = ReactModal.setAppElement;
export default WrappedGui; export default WrappedGui;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment